Teleport (ZScript)
Jump to navigation
Jump to search
Note: This function is for ZScript. For the ACS function of the same name see Teleport. |
bool Teleport(Vector3 pos, double angle, int flags)
Usage
Teleports the calling actor the specified position. In contrast to SetOrigin, allows adding some extra effects specific to teleports.
Parameters
- Vector3 pos
- Position to teleport to as a Vector3 value.
- double angle
- Absolute angle to set the actor's angle to after teleporting. (Verification needed)
- int flags
- Flags used by the function. Multiple flags can be combined with
|
. Available flags:- TF_TELEFRAG - Allow telefrag in order to teleport.
- TF_RANDOMDECIDE - Randomly fail based on health like A_Srcr2Decide does.
- TF_FORCED - Forget what's in the way. TF_Telefrag takes precedence over this.
- TF_KEEPVELOCITY - Preserve velocity.
- TF_KEEPANGLE - Keep angle.
- TF_USESPOTZ - Set the z to the spot's z, instead of the floor.
- TF_NOSRCFOG - Don't leave any fog behind when teleporting.
- TF_NODESTFOG - Don't spawn any fog at the arrival position.
- TF_USEACTORFOG - Use the actor's TeleFogSourceType and TeleFogDestType fogs.
- TF_NOJUMP - Don't jump after teleporting.
- TF_OVERRIDE - Ignore NOTELEPORT.
- TF_SENSITIVEZ - Fail if the actor wouldn't fit in the position (for Z).
- TF_KEEPORIENTATION - Combines TF_KEEPVELOCITY and TF_KEEPANGLE
- TF_NOFOG - Combines TF_NOSRCFOG and TF_NODESTFOG
Return values
- bool - Returns
true
if teleportation succeeded.
Examples
Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated. |