- Home /
Detect bounce amount
I have created a bouncer which has the "Bouncy" standard asset physic material assigned to its collider. The player bounces nicely upon collision with the collider.
Q1. How can I set a maximum bounce force threshold to limit maximum bounce. I like the way in which the bounce varies depending upon the impact but I would like to set a hard limit on the bounce height as a precaution.
Q2. Under OnCollisionEnter
how can I determine if the player has collided with a "Bouncy" material?
Answer by Berenger · Mar 07, 2012 at 07:40 PM
Q1 : When the object collided and bounced, clamp the magnitude of rigidbody velocity.
Q2 : declare a var of type Collision (let's say it's name is other) as argument of OnCollisionEnter. You can access the physic material of the collider with other.collider.material.
Your answer
Follow this Question
Related Questions
How can i create a character like dragon hill game, Digging underground, what collider should i use? 0 Answers
Camera gets flung off of the map when the player collides with certain objects. 0 Answers
Punching a crate 0 Answers
OnCollisionEnter() problems 1 Answer
Object with rigidbody bounces after hit. 0 Answers