- Home /
Avoid "bouncing" when colliding
I have a player-object running at a fixed speed in a 2d game. The player will run into a crate, and it's supposed to push the crate forward.
The problem is, when the crate is pushed, the player get's bounced a very tiny tiny step backwards - which I don't want.
The crate is pushed at an OnCollisionEnter2D event, by using "Vector2.MoveTowards"
Player object is non-kinematic
crate is kinematic
They both have RigidBodies2D
If I change them both to non-kinematic the bouncing wont happen. But the crate needs to be kinematic for other reasons.
Can someone point me in a direction to fix this problem?
Answer by GimLee · Nov 23, 2014 at 07:46 PM
Ok I fixed it by using the box as a trigger instead!
Answer by KMKxJOEY1 · Nov 23, 2014 at 01:19 AM
Use a PhysicMaterials on the box and set the bounciness to 0. To create a new PhysicMaterial right click in the project window and navigate to create. Then just drag it onto the Collider of the box.