Collision: Difference between revisions
(link to Object, description improvement) Tags: Mobile edit Mobile web edit Advanced mobile edit |
(Related page) Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
Line 33: | Line 33: | ||
Play a [[Play Sound|sound]] only if the impulse is big enough. | Play a [[Play Sound|sound]] only if the impulse is big enough. | ||
[[File:Collision example2.jpg|frameless|center|Example]] | [[File:Collision example2.jpg|frameless|center|Example]] | ||
== Related == | |||
* [[Collider]] | |||
[[Category:Blocks]] | [[Category:Blocks]] |
Latest revision as of 14:22, 23 August 2025
Collision
Type | Script block |
Collider | None |
Folder | Control |
Ports | |
---|---|
Inputs | Before 1st Object |
Outputs | Collided 2nd Object Impulse Normal After |
Detects collisions of the input object and outputs information about the collision.
Input:
- 1st Object: The object that will send the collision data to this script.
Output:
- Collided: Triggers when the input object collides with another object, including the floor.
- 2nd Object: The object that the input object collided with. It outputs "None" if collided with the floor.
- Impulse: The impact force of the collision (how hard did they collide). Specifically, impulse is a change of momentum of an object.
- Normal: The direction of the impact from the 2nd object to the 1st object.
Notes
- When colliding with multiple objects, only the most forceful collision will be reported.
- Because only one collision at a time can be detected, resulting in inconsistent behaviour, it is recommended to avoid using it for critical elements of the game in favor of other methods.
- If you're overriding physics to move objects (using Set Position) then no collisions will occur.
Examples
Lose if the sphere touches the ground.

Play a sound only if the impulse is big enough.
