- Home /
Check forward axis
Is it possible to determine which global axis a transform is facing?
I'm trying to make a dynamic parkour system where I check which side of a block I'm facing and from that determine where I should "climb" to.
Comment
Answer by Hellium · Jun 10, 2018 at 10:54 AM
Yes it's possible.
Simply check if the dot product between the forward vector and the desired required axis is greater than 0.8666 for example. It will mean that the two vectors are almost aligned.
https://docs.unity3d.com/Manual/UnderstandingVectorArithmetic.html