boundaries/walls question

POMPOM Member Posts: 2,599
edited November -1 in Working with GS (Mac)
i have an actor, and i control its movment by touch, so it follows your finger.
in my game i have a wall and i want this wall to be a boundary, so that if my actor collides with it, it just stay next to it, but beacuse the actor constraining its position to the touch, the wall dosent stop it and it overlaps it.
any ideas how can i fix it?

Comments

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    add a rule,
    if actor position = < (the x or y position of the wall)
    then actor position = touch position.

    Then if it reaches the wall position, touch will no longer work. As the rule above is not longer active.
  • POMPOM Member Posts: 2,599
    Hey thank you.. This should work if I had my wall standing straight
    but the wall in the scene is with an angle like so " \ "
    so the x and y of it is the middle of it (I think)
    yet.. Any help?!
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    hmmm... try adding a boolean game attribute, 'game.hitwall'

    then if the actor collides with wall, make 'game.hitwall true'

    then make you move to touch rule, only work when the game.hitwall attribute is false.

    something like that....

    any use?

    obviously tricky, not quite knowing what your scenes layout is like, you can always post a link to a still of your scene if it will help.
Sign In or Register to comment.