Jsut wondered if anyone can help me fix this.
It works kind of, but instead of the enemy retreating back to his litle base when i get out of his view, he looks up to the sky and moves off to the middle of the map somewhere.
There are no entities where hs is trying ot go, so I am totally confused now.
He just ignore his base.
While Not KeyHit(1)
If EntityVisible (Enemy1\model,player1\model)
MoveEntity Enemy1\model,0,0,.1
PointEntity Enemy1\model,player1\model;Turn towards player
If Animating(Enemy1\model)=Enemy1\walk
Animate Enemy1\model,1,.7,1;walkforward
EndIf
EndIf
If Not EntityVisible (Enemy1\model,player1\model)
Animate Enemy1\model,3,0,1,5;walk
PointEntity Enemy1\model,enemybase;Turn towards enemybase
MoveEntity Enemy1\model,0,0,.1
EndIf
If EntityDistance (Enemy1\model,player1\model)<=5
MoveEntity Enemy1\model,0,0,-.1
Animate Enemy1\model,1,0,3,5;stopped/idle
EndIf
It works kind of, but instead of the enemy retreating back to his litle base when i get out of his view, he looks up to the sky and moves off to the middle of the map somewhere.
There are no entities where hs is trying ot go, so I am totally confused now.
He just ignore his base.
While Not KeyHit(1)
If EntityVisible (Enemy1\model,player1\model)
MoveEntity Enemy1\model,0,0,.1
PointEntity Enemy1\model,player1\model;Turn towards player
If Animating(Enemy1\model)=Enemy1\walk
Animate Enemy1\model,1,.7,1;walkforward
EndIf
EndIf
If Not EntityVisible (Enemy1\model,player1\model)
Animate Enemy1\model,3,0,1,5;walk
PointEntity Enemy1\model,enemybase;Turn towards enemybase
MoveEntity Enemy1\model,0,0,.1
EndIf
If EntityDistance (Enemy1\model,player1\model)<=5
MoveEntity Enemy1\model,0,0,-.1
Animate Enemy1\model,1,0,3,5;stopped/idle
EndIf