the movement of an arrow
Hi. I am making a crossbow and other arrow stuff.
I have my arrow projectile. It flies through the air like an arrow apart from the fact that its rotation doesnt change while it is moving.
I thought a good way to solve this problem would be to use the last location and current location variables.
so basically i have a 3d line in space, from vector A to vector B and i want to find out which way this 3d line is pointing in terms of pitch, yaw and roll.
Can anyone help me?
can i use this native function at all?
function rotator OrthoRotation( vector X, vector Y, vector Z );
Vector B - Vector A will give you a vector for the line of fire.
To get this as a direction you need to normalise it (turns it into a unit vector, a vector with a magnitude of one). From that you can turn it into a rotator.
here is how it would look in code:
local vector A,B;
local rotator rot;
thankyou. I knew it was something along those lines.
I have quite a cool arrow now which moves nicely and sticks in walls.