Wierd Collision Bug?

RedlerTechRedlerTech Member Posts: 1,583
edited November -1 in Working with GS (Mac)
Hey Everyone,
I'm trying to make a simple game to show my cousin what GameSalad can do. We're almost finished exept for this bug. Our controls is press and drag. Now I know collisions do not work when constrained, but what about in a rule when overlaps or collides? If I don't even touch the actor to constrain it, and lay it right in the center to overlap, GameSalad won't pick it up. 0.9.5 bug?

Comments

  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    Yeah, it's possible that it is a GS bug, but you can find an alternative if it is just a question of picking up an actor.

    Let me get this streight:
    To drag the actor you constraining it to the mouse position. You basically want to pick up an object (another actor) whilst you are dragging it?

    Could you explain in more detail your problem, it's a bit confusing.

    Giacomo
  • RedlerTechRedlerTech Member Posts: 1,583
    Okay, the game is to get move an actor from one side of the screen to the other. Without getting hit from an actor in the center.

    The controls is from this video:


    Anyway, when the player collides with the thing in the center, it is set to change level back to one. But it doesn't recognize the collision.

    Matt
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    A work around would be to create 5 attributes:
    "X" and "Y" and "W" and "H" and "collide"

    In the actor you are dragging:
    Constrain X to self.positionX
    Constrain Y to self.positionY
    Constrain W to self.Width
    Constrain H to self height

    In the colliding actor:
    Rule
    ------------
    When attribute Game X > (sel.positionX+(attribute W/2)+(self.width/2))
    or When attribute Game X < (sel.positionX-(attribute W/2)-(self.width/2))

    Rule Inside First rule=
    When attribute Game Y > (sel.positionY+(attribute H/2)+(self.height/2)
    or When attribute Game Y < (sel.positionY-(attribute H/2)-(self.height/2))

    Change attribute game.collide to 1

    That will probably although I havn't tested it.

    Note: when game.collide=1 you can apply the same rules as you would have done if the actor recognised the collision.

    Giacomo
  • RedlerTechRedlerTech Member Posts: 1,583
    Thanks, is this just a bug with all overlap or collide rules?

    Matt
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    Not sure actually, the explanation above is just a work around... I havn't been using the overlap or collide rules recently and I havn't heard any bugs of it so it would be a good idea if you reported it to GS. ;)

    Giacomo
  • entersimonentersimon Member, PRO Posts: 273
    Collisions can occur with constrains, it's interpolate that removes collisions. Make sure you aren't doing any x,y interpolation in either actor that's going to collide.
Sign In or Register to comment.