enemy rotate & move up to player good for IA

I didn't ask a question. Rather I was offering a suggestion.karim1a2004 wrote:I did not understand your question
Code: Select all
Public Sub GetTargetAngle(ByVal Enemy As ISceneNode, ByVal Player As ISceneNode, ByVal Factor As Single)
Dim angle, v, r As Vector3D
Dim x, y, z As Integer
v = Enemy.AbsolutePosition : r = Player.AbsolutePosition
x = r.X - v.X
y = r.Y - v.Y
z = r.Z - v.Z
angle.Y = Atan2(x, z)
angle.Y *= (180 / PI)
If (angle.Y < 0) Then angle.Y += 360
If (angle.Y >= 360) Then angle.Y -= 360
angle.Y = angle.Y - Factor
Enemy.Rotation = New Vector3D(angle.X, angle.Y, angle.Z)
' Return angle
End Sub