logic_measure_movement

From Source Entities
Jump to navigation Jump to search

Code classes:

logic_measure_movement is a point entity present in all Source games. It measures the position of an entity relative to another entity, then moves a third entity in a similar way, relative to a 4th entity. This can be used to make an entity move as if it's parented, but rotate on its own axes.

Tip: Two logic_measure_movements can be set up to make two entities move each other equally, but it may look jittery.

Bug: In P2.png the Entity to Move's solidity is somehow juxtapositioned between where it appears to be, and where it was when it spawned/became part of the movement system. If something bumps into the spot where the entity was, it will get moved back to that spot and stay there until it quits moving, before moving back to the correct spot. The entity will also move incorrectly if the player picks it up. This can only be prevented by making the entity non-solid and unable to be picked up.

Note: Neither of the references can be the logic_measure_movement itself, or odd behavior will occur.

Keyvalues[edit | edit source]

Entity to Measure (MeasureTarget) <target_destination>
The entity which will have its movement measured. !player may be used here.
Measure Reference (MeasureReference) <target_destination>
The entity that Entity to Measure will be measured relative to.
Movement Reference (TargetReference) <target_destination>
The entity that Entity to Move will move relative to when Entity to Measure moves. When this entity moves, Entity to Move will move as if it were parented to it.
Entity to Move (Target) <target_destination>
The entity that will move relative to Movement Reference in the same manner that Entity to Measure moved relative to Measure Reference.
Movement scale (TargetScale) <float>
Divider for how far away Entity to Move is from Movement Reference. 0.5 will make the entity move double the amount that Entity to Measure does.
Measurement Type (MeasureType) <choices>
If Entity to Measure is something with eyes (e.g. the player), use Eye position to check the direction the entity is looking in, instead of the actual Pitch Yaw Roll.
  • 0: Position
  • 1: Eye position

Inputs[edit | edit source]

SetMeasureTarget <target_destination>
Sets Entity to Measure.
SetMeasureReference <target_destination>
Sets Measure Reference.
SetTargetReference <target_destination>
Sets Movement Reference.
Target <target_destination>
Does not exist in code!
SetTarget (Not in FGD) <target_destination>
Sets Entity to Move.
SetTargetScale <float>
Sets Movement scale.

See Also[edit | edit source]