Not meaning to hijack this thread, but since there's some math majors here I got a little problem too.
This code was taken from the archives and the idea is it's supposed to aim and move your object towards a 3d point. It works most of the time but sometimes it doesn't, I think when it hits negative values or something. I suck at math so I'm not sure how to fix it to be 100% accurate.
Thanks
This code was taken from the archives and the idea is it's supposed to aim and move your object towards a 3d point. It works most of the time but sometimes it doesn't, I think when it hits negative values or something. I suck at math so I'm not sure how to fix it to be 100% accurate.
For e=1 To 35 PointEntity enemy[e]\pivot,player targetangle#=EntityYaw(cam,True) currentangle#=EntityYaw(enemy[e]\pivot) If Abs(currentangle#-targetangle#)<180 Then turn=2 Else turn=-2 If currentangle#<targetangle# TurnEntity enemy[e]\pivot,0,turn,0 Else If currentangle>targetangle TurnEntity enemy[e]\pivot,0,-turn,0 EndIf EndIf MoveEntity enemy[e]\pivot,0,-0.5,.5 Next
Thanks