How to stop an actor
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
Thanks
Best Answers
-
The_Gamesalad_Guru Posts: 9,922
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_SFX Posts: 9,273
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...My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Answers
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
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx