Skip to content

PullEffect ​

Inherits: MoveDirectionalEffect < CompositeEffect < Effect < DatabaseResource < Resource

PullEffect: Physics impulse toward originator position Perfect for force pull abilities, magnetic effects, and grappling hooks

Properties ​

floatinitial_force10.0
floatupward_force0.0
floatmovement_duration1.0
floatfriction_coefficient0.9
boolstop_at_originatortrue
floatstop_distance1.0

Methods ​

voidapply_movement( effect_instance: EffectInstance, entity: Entity, direction: Vector3 )
voidhandle_movement_collision( effect_instance: EffectInstance, collision: KinematicCollision3D )
voidon_movement_timer_finished( effect_instance: EffectInstance )
Stringget_effect_description()
Stringget_editor_description()

Property descriptions ​

Pull Settings

float initial_force = 10.0 ​

Initial velocity burst strength pulling toward originator

float upward_force = 0.0 ​

Additional upward force component (0.0 = no upward pull)

float movement_duration = 1.0 ​

How long the displacement effect lasts

float friction_coefficient = 0.9 ​

How quickly displacement decays each frame (0.8 = fast decay, 0.95 = slow decay)

bool stop_at_originator = true ​

Whether to stop when reaching the originator (prevents overshooting)

float stop_distance = 1.0 ​

Distance from originator where movement stops (if stop_at_originator is true)

Method descriptions ​

void apply_movement( effect_instance: EffectInstance, entity: Entity, direction: Vector3 ) ​

Moves the entity one step in the direction of the movement.

void handle_movement_collision( effect_instance: EffectInstance, collision: KinematicCollision3D ) ​

Called when the moving entity hits something: it bounces or stops, by the settings of the effect.

void on_movement_timer_finished( effect_instance: EffectInstance ) ​

Called when the time of the movement is over.

String get_effect_description() ​

The text of the effect for tooltips, with its values filled in.

String get_editor_description() ​

A short text for the effect editor that says what the effect does.