Make collision work while dragging out objects

AsymptoteellAsymptoteell Member Posts: 1,362
edited November -1 in Working with GS (Mac)
I am making a game where I drag out rods like in this demo http://gamesalad.com/game/7960

I want the rod to change colors, or spawn a red x or something when one rod collides with another.

It is a physics game so I have game attribute game.Physics. I want the rule to only be active when game.Physics=0.

So I have a rule that says when game.Physics=0 and actor overlaps or collides with actor with tag Physics (the tag for all collidable actors) spawn actor red x.

What happens is when I drag one rod into another, nothing happens until I release the mouse button.

Can anyone help/tell me how to make the x appear before I release the mouse button.

Thanks,

Asymptoteell

Comments

  • AjBlueAjBlue Member Posts: 215
    is your on collide spawn red X code, inside the rule for (on touch move object)...? thats the only thing i could think of
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Thanks for the idea, but when I do that, it doesn't work at all because if i've released the mouse, the touch move rule doesn't work, and if I don't release it, the actor doesn't spawn.
    Asymptoteell
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Try this. for the move rule have when touch is pressed and when touch is inside. constrain x and y to mouse position x and y.

    Then have another rule when touch is pressed and object collides with physics actor, spawn actor.

    Make sure its when all conditions are valid.

    And put the collide rule in otherwise, you might end up having to take that out, try that first though
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Didn't work, John.

    Now I needed to release and press to make it spawn.

    Thanks for the advice, though.

    Asymptoteell
Sign In or Register to comment.