How to stop an actor

ecscessecscess Member Posts: 23
edited July 2012 in Working with GS (Mac)
Hello, how can I stop an actor when reaches the destination. Imagin an object, any object hits a wall. The object must stop even the player keep draging. The movement of this actor is by draging or tilting the phone (accelerometer). Help me please with both situations.

Thanks

Best Answers

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,922
    Accepted Answer
    Rule

    When actor overlaps or collides with wall

    Change attribute linear velocity x to 0

    Change attribute linear velocity y to 0

    This will work for the accelerometer but dragging while constrained to the mouse position overrides collisions so tshirt has a video about that issue on his site.
  • Braydon_SFXBraydon_SFX Posts: 9,273
    Accepted Answer
    What if you create a attribute (boolean) that are set to true.

    So the accelerometer rules will only work when that attribute is set to true.

    When you overlap or collide with the wall, change that attribute to false.

    Try that...

Answers

  • ecscessecscess Member Posts: 23
    no, if the phone is still tilt..my actor don't stop.
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    edited July 2012
    So it's not working? Try putting it in a timer :

    For 0.2 seconds:
    Change attribute linear velocity x to 0
    Change attribute linear velocity y to 0
    Change attribute linear angular velocity to 0
  • ecscessecscess Member Posts: 23
    no. same thing, if the phone is still tilt..my actor don't stop.
  • ecscessecscess Member Posts: 23
    its working...some how. Not ideal but satisfactory. Thanks a lot
Sign In or Register to comment.