turning one object towards another one

Blitz3D Forums/Blitz3D Programming/turning one object towards another one

Try using AlignToVector. You can set a tweening/turning rate parameter to do a smooth turn. If the entity turning is called "avatar" and the entity being faced is "target" the code is:
AlignToVector avatar,EntityX(avatar)-EntityX(target),0,EntityZ(avatar)-EntityZ(target),1,0.2

Call this every frame as part of the enemy's movement code.