SetActorPosition

From ZDoom Wiki
Jump to navigation Jump to search

bool SetActorPosition (int tid, fixed x, fixed y, fixed z, bool fog)

Usage

This function sets the x, y, and z coordinates of the specified actor, with or without teleport fog. The coordinates are specified in fixed point. See also: GetActorX, GetActorY, GetActorZ.

Return value

Returns true if the actor position was changed successfully, and false otherwise.

Example

Here is a script that will move a decoration with a tid of 1 to stay at an equal vertical plane with the player.

#include "zcommon.acs"

script 1 ENTER
{
    while (TRUE)
    {
        SetActorPosition(1, GetActorX(1), GetActorY(1), GetActorZ(0), 0);
        delay(1);
    }
}

Note that this script will only work for one player.