Smart turning

Blitz3D Forums/Blitz3D Beginners Area/Smart turning

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.

I am making a turret for my a.i. test and I was wondering if there was a easy way to make the turret turn to face the player without pointentity,turret,player
right now I have

if entitydistance(turret,player) =< 25 and entitypick(turret,25)=player then
pointentity turret,player
fire#=fire#+1
else
turnentity turret,0,1,0
endif


I am trying to do a Z and X axis check but I'm a little confused
can someone help me?