- Home /
Physic material bounciness too weak
i'm trying to create a trampoline effects, but when I create a 2d physics material, the force of bounce is not what I want, I want it to have more power when bounced, before it hit.
I also tried this piece of code, which works, but in order to make it correct, I should flip the Y-axis direction of the vector, anyone an idea?
collider.transform.rigidbody2D.velocity = -collider.transform.rigidbody2D.velocity * 1.5f;
Thanks
Comment
Best Answer
Answer by NickP_2 · Apr 24, 2014 at 05:38 PM
I found it:
If anyone else wants to know, I rotated the force with Pi:
Vector3 velocity = -collider.transform.rigidbody2D.velocity;
velocity = Quaternion.Euler(0, 180, 0 ) * velocity;
collider.transform.rigidbody2D.velocity = velocity * 2f;
A picture of what it does:
screenshot 2014-04-24 19.38.50.png
(26.8 kB)