Move A closer to B?
#1

Hello!

I'm trying to make a basic zombie actor, and the problem is a zombie 'chasing' the player, that is actor moving 1 unit closer to a player.

Of course, I have this:

Код:
new Float:zX, Float:zY, Float: zZ;
GetActorPos(AZombie[i][zAZ], zX, zY, zZ);

new Float:pX, Float:pY, Float: pZ;
GetPlayerPos(playerid, pX, pY, pZ);
Now what I'm supposed to do in SetActorPos now? Some complicated math I guess?
Reply
#2

You can try applying a walking animation after setting the angle to match the player though I heard someone say actor's won't move even if the ApplyActorAnimation lock parameter is disabled. You can try it, though I can't say for sure it will work.

Though, you can try to use SetPlayerPos(which will probably look choppy) if the above solution doesn't work, setting small intervals at a time. Such as gradually increasing their X or Y position using a timer updating every few seconds.
Reply
#3

I'd really like to use walking animation but SetActorFacingAngle is (from what I've checked and ******d) bugged and it doesn't spin the actor.
Reply
#4

pawn Код:
SetActorPos(AZombie[i][zAZ], zX+1, zY, zZ);
It's as simple as. Don't listen to Abagail, he's full of shit lol. Always tries to make essays out of everything thinking he gets more credit doing so.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)