Getting an entity to turn and face another entity?
Blitz3D Forums/Blitz3D Programming/Getting an entity to turn and face another entity?
| ||
Anymore know how to do this? |
| ||
Try this RotateEntity enemy,0,DeltaYaw#(player,enemy),0 |
| ||
I'd prefer to use AligntToVector, but I'm not sure how to get the vector. |
| ||
It is sort of like this, I think:bx#=EntityX(the other entity))-EntityX(first entity) bz#=EntityZ(the other entity))-EntityZ(first entity) bn#=Sqr(bx^2+by^2+bz^2) bx=bx/bn bz=bz/bn AlignToVector first entity,bx,0,bz,0,.1 MoveEntity first entity,0,0,.05 |