- Home /
Bouncing on collision
Currently I have a moving object and when I collide into any other object it bounces back a little bit... On impact the moving object goes a little to far into the other object and then it gets pushed back so there is no contact between the objects. I tried to restrict the bounce by this code, though it does not work.
private void OnCollisionEnter (Collision otherCol)
{
rigidbody.velocity = Vector3.zero;
}
I had the same issue, but the only solution I could find was to change the mesh of the objects.
Try:
Edit>Project Settings>Physics
Set '$$anonymous$$in Penetration for Penalty' to 0.0.
Also:
Edit>Project Settings>Time
Set FixedTimestep from 0.02 to 0.01.
This was exactly what I was looking for. Thanks!
You may also want to take a look at this answer:
http://answers.unity3d.com/questions/462907/how-do-i-stop-a-projectile-cold-when-colliding-wit.html
While it's not exactly your situation, you may be able to borrow from it conceptually.
Your answer
Follow this Question
Related Questions
How to make my moving object bounce 2 Answers
How to get a perfect bouncing ball. 6 Answers
how the ball bounces of equal in angles? 1 Answer
Unity 2D - How do I add the velocity and direction of an object to another object? 2 Answers
Both Kinematic and Non-Kinematic behaviours at the same time. 1 Answer