Right or Left

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

TUM

FNG / Fresh Meat
Mar 27, 2010
41
5
0
Hi guys.
I have an Actor with Location1 and Rotation1. My location is Location2.
How can i know i'm right or left from the Actor???
 

Marco

Active member
May 23, 2009
645
232
43
Finland
Use dot product and getaxes:
Code:
	local vector X,Y,Z;
	GetAxes(Rotation1,X,Y,Z);
	if( (Y Dot (Location2 - Location1))<0 )
		// left side...
	else // right side.
 
  • Like
Reactions: YoYoBatty

scary ghost

FNG / Fresh Meat
Sep 13, 2010
900
338
0
California
Actually the xyz co-ordinates are important. They determine which way you will be going.

That's not what he's asking. He is asking for a generic method that works for any (location, rotation, location) tuple, not, whether given a specific set of values , if they're left or right of each other. The code Marco gave does just that, determines right or left without hard coding anything.
 
Last edited: