Making an actor face the player
#5

Код:
SetActorToFacePlayer(actorid, targetid) {
    new
        Float: pX,
        Float: pY,
        Float: tX,
        Float: tY
    ;
    return
        GetPlayerPos(targetid, tX, tY, Float: targetid) &&
        GetActorPos(actorid, pX, pY, Float: targetid) &&
        SetActorFacingAngle(actorid, -atan2(tX - pX, tY - pY))
    ;
}
By Nero_3D
Reply


Messages In This Thread
Making an actor face the player - by Sellize - 10.05.2015, 16:25
Re: Making an actor face the player - by MicroD - 10.05.2015, 17:00
Re: Making an actor face the player - by MP2 - 10.05.2015, 17:01
Re: Making an actor face the player - by Sellize - 10.05.2015, 17:02
Re: Making an actor face the player - by MicroD - 10.05.2015, 17:06

Forum Jump:


Users browsing this thread: 2 Guest(s)