- Home /
Full impact force vs sliding impact force
I have a script that does sound and particle effects if the impactForceSum.magnitude is greater than an amount. It works fine for regular impacts, but when an object is dragged (via a physics rope) over a collider at high speeds and the object begins to jump around a little (triggering OnCollisionEnter), the sliding impact force is still great enough to trigger the effects.
Is there a way to stop that happening? Maybe some way to tell the difference between a full impact and a glancing impact?
Answer by luizgpa · Feb 10, 2012 at 05:24 PM
I think impactForceSum actually returns the same value of relativeVelocity (at least in my tests). impactForceSum is not on the documentation, so I don't think you should use it.
To not trigger the effects when the is sliding you should also consider the normal from the contact points. For instance, if the relative velocity is greater then the threshold but the angle between the velocity and the surface normal is around 90°, that means that the object is sliding.
Thanks, that makes perfect sense to use the normal.
Also right about impactForceSum, they are returning the same magnitude for me too. Is it a good idea to use relativeVelocity for impact measurement? Or maybe I should use something else?
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Hooking RigidBody.AddForce 0 Answers
If statment to check if player is within collider 1 Answer
Parenting player to car on click. 1 Answer
Set Velocity at relative position. 2 Answers