OBJECT FACING POS [ L00K ]
#1

How can I get the object to face the next object?



If I have the x,y,z of the next object, what axis to I take to set the rot on the previous object to face the next?

Thanks

Kyle
Reply
#2


Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
You need to set the z rotation (yaw).
This screenie is with only the Y rot set:



As you can see some are correct pre done, but even if I do set the Z, it's going to be out again where others will be fine and others not as if I use like SetObjectFacingPos it makes them all go wacky.
Reply
#4

New Float, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);
New Float:a, GetPlayerFactingAngle(playerid, a);
CreateObject(objid, x, y, z, a..);
Reply
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
That could be something to do with this:

http://forum.sa-mp.com/showthread.ph...12#post1459812
How can this be fixed?
Reply
#6

some objects by default don't point in 0 angle on z axis, so you need to adjust all axes properly..
Reply
#7

Quote:
Originally Posted by JernejL
Посмотреть сообщение
some objects by default don't point in 0 angle on z axis, so you need to adjust all axes properly..
But how should I know the angles and how to calculate them when I'm not a mathmatical genius.
Reply
#8

Quote:
Originally Posted by KyleSmith
Посмотреть сообщение
This screenie is with only the Y rot set:



As you can see some are correct pre done, but even if I do set the Z, it's going to be out again where others will be fine and others not as if I use like SetObjectFacingPos it makes them all go wacky.
Guys, is there a way to check where the next arrow is heading, so, if the next arrow is infront face it infront, or if its going to the left face it left?
Reply
#9



That image is with NO rotational axis being set, the image below sets the Z rotational angle using this function:

http://pastie.org/2705005

When that function is used to face the node to the next one this what happens, some work some don't:



I need a way to only do certain ones, maybe like check if the next node is going left, right, up or down. Then decide where to face?
Reply
#10

Check the useful functions topic, on page 256 you'll see my function or on 257-268 you'll see ryders (I recommend ryders)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)