Collision without bounce?

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

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    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.

  • MalkovichMalkovich Member, PRO Posts: 116

    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.

  • dmorin@gmail.comdmorin@gmail.com Member Posts: 19

    Success! I had to turn off the bounciness on both actors. Thanks!

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Glad you got it working.

Sign In or Register to comment.