SetOrigin

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.

void SetOrigin (vector3 newpos, bool moving)

Usage

SetOrigin sets the actor's world coordinates to the specified position. Unlike SetXYZ, SetOrigin automatically relinks the actor to the blockmap and sectors.

Parameters

  • newpos - The new position to go to.
  • moving - If true, the actor is interpolated from the old position to the new. Otherwise, they simply snap into place.

Examples

This imp ball always hits. Always.

class CheaterImpBall : DoomImpBall
{
    override void PostBeginPlay()
    {
        super.PostBeginPlay();
        if (target && target.target) //ensure that the shooter even has a target
            SetOrigin(target.target.pos+(0,0,target.target.height*0.5),false); //warp to middle of shooter's target
    }
 }