- Home /
How can I find all of the forces that come on a certain box?
I have a hitbox on a character, and I want to be able to do X if the box receives a high impact force. Where should I begin with this?
http://www.unity3dstudent.com/2010/07/beginner-b01-basic-collision-detection/
http://docs.unity3d.com/Documentation/ScriptReference/Collider.OnCollisionEnter.html
$$anonymous$$ore info on tutorials :
Start at the bottom and work up : http://www.unity3dstudent.com/category/modules/essential-skills/
Start at the bottom and work up : http://www.unity3dstudent.com/category/modules/beginner/
the Unity Wiki : http://wiki.unity3d.com/index.php/Tutorials
A list of resources : http://answers.unity3d.com/questions/12321/how-can-i-start-learning-unity-fast-list-of-tutori.html
Answer by DuxDucis · Dec 10, 2012 at 12:47 PM
Try this, and tweak the certainMagnitude variable to suit you
void OnCollisionEnter(Collision collision){
if (collider.rigidbody != null){
if (collider.rigidbody.velocity.magnitude > certainMagnitude){
DoStuff();
}
}
}