Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

setorigin

From Quake Wiki

Revision as of 01:48, 31 July 2023 by Boondorl (talk | contribs)

void setorigin(entity e, vector newPos)

Usage

Sets the entity's position. This should be used over setting origin manually since it will properly relink the entity into the world. This can also be used as an easy way to relink an entity after changing their solid type by passing their current position.

Parameters

  • e
The entity to set the origin of.
  • newPos
The new location to place the entity.

Example

vector angs = e.angles;
angs_x = -angs_x;
makevectors(angs);

// Move the entity 32 units forward in the direction it's facing
setorigin(e, e.origin + v_forward*32);