An Arrow to a Point
#2

have a look at the atan2 function:
pawn Code:
new Float:Angle=-(90+(atan2(YA-YB,XA-XB)));
all you need is the offset between both locations (x and y axis, the height can be ignored i guess). to get the offset, simply subtract x2 from x1, and y2 from y1. then apply the atan2 function with those 2 offsets. it will return an euler angle. idk if its a good advice to simply remove the -90 degrees in that formula, but feel free to experiment with it. this version takes the z-axis flipping relation betwen a player and objects (left/right handed) into account, thats why iam sure it could work for you
Reply


Messages In This Thread
An Arrow to a Point - by blackybecks - 29.01.2012, 01:18
Re: An Arrow to a Point - by Babul - 29.01.2012, 01:26
AW: An Arrow to a Point - by blackybecks - 29.01.2012, 01:37

Forum Jump:


Users browsing this thread: 1 Guest(s)