Script:attractor: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
|intro=The player is pulled or pushed whenever in the specified radius around the entity with a force linearly falls of with increasing distance from the entity and vanishes at the specified radius. Attractors on entities with collision disabled are ignored. | |intro=The player is pulled or pushed whenever in the specified radius around the entity with a force linearly falls of with increasing distance from the entity and vanishes at the specified radius. Attractors on entities with collision disabled are ignored. | ||
}} | }} | ||
{{Warning|Attractors are '''not''' stored in save files. Any attractors that are meant to be persistent need to be re-added on load in the {{Event|game_ready}} event.}} |
Revision as of 07:10, 24 September 2022
The attractor
script command is used to pull/push the player towards/away from an entity. The player is pulled or pushed whenever in the specified radius around the entity with a force linearly falls of with increasing distance from the entity and vanishes at the specified radius. Attractors on entities with collision disabled are ignored.
Usage
attractor <entity> <power*> <radius*>
attractor <entity> off
Context: For self
Parameters:
Parameter | Type | Description |
---|---|---|
entity |
entity |
The entity to pull the player towards or push the player away from |
power |
number or variable |
The force of attraction, positive to pull or negative to push |
radius |
number or variable |
The range of attraction |
⚠️
Attractors are not stored in save files. Any attractors that are meant to be persistent need to be re-added on load in the
game_ready
event.