Answers for "Trouble Understanding Vector3.Angle() Result"
http://answers.unity.com/questions/814563/trouble-understanding-vector3angle-result.html
The latest answers for the question "Trouble Understanding Vector3.Angle() Result"Answer by SimonTS
http://answers.unity.com/answers/814881/view.html
You should not use your rigidbody velocity for this. Instead use the relativeVelocity field of your Collision object, like this:
void OnCollisionEnter(Collision other) {
float angle = Vector3.Angle(other.relativeVelocity, other.contacts[0].normal));
// do stuff with angle
}
This will give you the angle between your projectile and the other colliders surface normal.
lgWed, 22 Oct 2014 17:40:27 GMTSimonTSAnswer by popuppirate
http://answers.unity.com/answers/814638/view.html
Try the following:
float angle = Vector3.Angle (thisRigidbody.transform.position.up, transform.somereference.up);
Make a reference object that is flat and non kinematic, like a plane, and use this as an up reference. The angle function will return the angle from the rigidbody's up to the reference's up in radians.
Convert radians to degrees with (180/(2*Mathf.PI))
This is off the top of my head, so sorry if it's not what you were after!
Cheers,
PopuppirateWed, 22 Oct 2014 12:03:05 GMTpopuppirate