I have the 3d vector to where I am heading. How can I face that direction?
function SeekTarget(target as vector3, location as vector3, velocity as vector3, maxspeed as float, ID)
desired as vector3
steer as vector3
maxforce# = 1.00
desired = SubtractVector3(target, location)
desired = NormalizeVector3(desired)
desired = ScaleVector3(desired, maxspeed)
steer = SubtractVector3(desired, velocity)
steer = limitForce(steer, maxforce#)
location = AddVector3(steer, location)
// how to get myself to point towards location
SetObjectPosition(ID, location.x, location.y, location.z)
endfunction steer
Thanks.
edit: Using setobjectlookat() before I move the object works. Is this the quickest way for the processor?