Author Topic: [Solved] Detecting movement direction  (Read 825 times)

Hi all, I'm trying to detect movement direction relative to where the player is facing but I'm not sure what I'm looking at in the getTransform function. The first three are coordinates, followed by three numbers which I don't know, and the last I'm guessing is the angle of where you're looking? I need to understand what the "0 0 1" is because sometimes it changes to "0 0 -1" and I have no idea.

After I find the angle the plan is to do two checks of position relative to the direction they're facing to determine what movement keys the player is holding down. I'm hopefully gonna make a cool melee combat system using this
« Last Edit: January 29, 2016, 12:20:37 PM by Jervan »



SetTransform uses some sort of vector angle rotation so if you used /gettransform the results would be:

[posx] [posy] [posz] [rotationvectorx] [rotvy] [rotvz] [theta]

positions are floating point.
the rotation vector is defined by the end point in a line from 0,0,0 that is 1 unit long.
theta goes from 0 to 2pi.
So settransform("0 0 5 1 0 0 3.14") would turn a vehicle upside down around the x axis.  I think.

So it's like.  You draw a line from the center of your object.  And then you rotate around that line.
And then the position of the object is just simple xyz coords.

Thanks, that's really simple! Awesome!