turning one object towards another one

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

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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.