Hi folks,
There is probably a simple answer to this but I have been having trouble figuring it out and have not found any solutions on here or other forums.
Basically, I am trying to determine how far a child object has strafed to the left or right relative to its direction.
This is very easy if the object is facing along the z axis.
It is transform.localposition.x
When the object rotates -90 and is now facing to the left, the strafe is now on z axis.
So it would be transform.localposition.z
The question is how to get this strafe distance for any facing angle (not up or down just left/right) ie 37 to the right or -16 to the left etc.
Cheers,
GreenLotus