Posts: 400
Threads: 69
Joined: Apr 2009
Reputation:
0
How can i calculate the "SetPlayerFacingAngle",
so that the person i want to interact with is facing another player ?
Found "GetXYInFront" or sth similiar,
but i dont think, that its made for this.
So, i hope someone can help me with this.
Last time i made a loop from 0 to 360 degrees and checked, if the person is close to this,
but this is very ressource wasting...
Posts: 1,464
Threads: 11
Joined: Jan 2008
Reputation:
0
Find some function which calculates the angle between 2 points, then get the angle between player A and player B and check if the angle is equal to player A's facing angle. If it is so - do what u want.
Edit: Oh, you wanted to SET the facing angle? So calculate the angle and set the other player's facing angle to that. lol
You might need to make it OPPOSITE angle, so just do angle -= 180.0.
Posts: 400
Threads: 69
Joined: Apr 2009
Reputation:
0
That doesnt make sense.
It doesnt matters, where Player A is looking, to get Player B looking to him.
I just want to retrieve the angle,
which i have to set, to make Player A looking at Player B
Posts: 2,938
Threads: 162
Joined: May 2010
180>?
[edit] u want setplayerfacingangle(playerid, anglehere?)
Posts: 517
Threads: 22
Joined: Mar 2010
Reputation:
0
Wouldn't that be extremely buggy? for example, if you were to set the X/Y and there was a building next to you?
Anyway, it's just an example (lol even I learnt something.. didn't know what Floatabs was)