stopping click thru

peastonpeaston Member, PRO Posts: 25
HI All,
I have a game that allows user to move objects around the screen but when they overlap objects they have no way to separate them. Once an object overlaps another the touch-move script ends up moving both objects, is there a way to prevent the touches from lower layered objects ?
thanks in advance
Pete

Comments

  • TheGabfatherTheGabfather Member Posts: 633
    Take note of the layering of your actors. Whenever a lower layered Actor collides with a higher layered actor, disable its Rule that allows it to be dragged. By disable, I mean negate the conditions of being draggable.

    To do this, you will need a boolean attribute that checks for collisions. True if the actor collides with a higher layered actor, and False otherwise.

    So add an Attribute condition to your drag Rule alongside your Touch condition ("When ALL are happening") (e.g. If collideAtt == False && If Touch is Pressed).

    Well, that's one way of doing it. Good luck! :)
Sign In or Register to comment.