Quick question- what is the most efficient way to detect which way an object is facing?
To provide an example, I have a character who can move forwards, up, or down (using the arrow keys). What I want to be able to do is:
a) Establish which way the character is currently facing.
b) Once established to either rotate that character 180 degrees (to flip his direction) if the player tries to move ‘backwards’ (e.g. the opposite way he’s currently facing) OR effectively do nothing if the character is just trying to move forwards (the way he’s currently facing).
Once I can work out how to detect which way he’s facing, I’ll be able to add in my script to rotate him.
Thanks in advance for any suggestions.