Collision without bounce?
dmorin@gmail.com
Member Posts: 19
I'm trying to put together a simple maze game and implemented a rule that says "If the key is down, go in that direction." That part works. (I did this by Accelerating in the desired direction, in case there's a different/better way).
Then I added, "If overlapping with an actor of type Wall, set your velocity to zero."
That works too, except for one problem. If I then press the direction key again, my player goes ahead and starts up and runs right across my wall.
I tried the Collide behavior, but I don't want a bounce, I want a stop. Everything I've googled always takes me back to collide, but I just want my actor to stop, and not be able to proceed no matter how many times he hits that direction key.
Comments
Make sure the Bounciness option under the Physics Settings of both actors is set to 0, that should stop the bounce when using a Collide Behavior.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Just use the collide behavior. In the actor attributes set bounciness to 0 (under physics attributes). Do the same with the wall actor. I thinks that solves your problem.
Nix the Cat: Jump Adventure * Twitter * Facebook
Success! I had to turn off the bounciness on both actors. Thanks!
Glad you got it working.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page