Script:collision: Difference between revisions
(Created page with "{{ScriptCommandPage |description=enable or disable collisions |context=any |parameters= enable bool Enable or disable collisions |intro=With collisions disabled, other entities including the player can move trough this one. For pathfinding, the nodes covered by the entity need to be enabled or disabled separately using {{Command|anchorblock}}. }} == Collision errors == If on re-enabling collisions, the entity overlaps with other entities (that have collisions enabled)...") |
mNo edit summary |
||
Line 9: | Line 9: | ||
== Collision errors == | == Collision errors == | ||
If on re-enabling collisions, the entity overlaps with other entities (that have collisions enabled) then, for each colliding entity, the {{Event|collision_error_detail}} event is sent asynchronously to the calling entity with the colliding entity as the sender, followed by a single {{ | If on re-enabling collisions, the entity overlaps with other entities (that have collisions enabled) then, for each colliding entity, the {{Event|collision_error_detail}} event is sent asynchronously to the calling entity with the colliding entity as the sender, followed by a single {{Event|collision_error}} event. Asynchronous here means that the script for these events won't execute until some time after the current event completes, not during the {{Command|collision}} call. |
Revision as of 16:50, 22 June 2022
The collision
script command is used to enable or disable collisions for an entity. With collisions disabled, other entities including the player can move trough this one. For pathfinding, the nodes covered by the entity need to be enabled or disabled separately using anchorblock
.
Usage
collision <enable>
Context: Any Entity
Parameters:
Parameter | Type | Description |
---|---|---|
enable |
bool |
Enable or disable collisions |
Collision errors
If on re-enabling collisions, the entity overlaps with other entities (that have collisions enabled) then, for each colliding entity, the collision_error_detail
event is sent asynchronously to the calling entity with the colliding entity as the sender, followed by a single collision_error
event. Asynchronous here means that the script for these events won't execute until some time after the current event completes, not during the collision
call.