Collider

From Resonite Wiki
Revision as of 20:16, 14 October 2024 by 989onan (talk | contribs) (template collider type descs)

A Collider is a component that controls how a Slot interacts with other colliders. Colliders have shapes that determine the boundary of interaction, and the component is always of a particular shape:

Two colliders are said to be in collision when they intersect each other. Collision events can be detected through the On Contact Start, On Contact Stay, On Contact End ProtoFlux nodes, which take a Collider component. They then check the given Collider, and output an impulse along with the other Collider that triggered the collision.

Aside from the properties determining the shape of the collider, all colliders have the following properties:

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
Offset Float3 The offset of the collider shape's position from the slot's position.
Type ColliderType The type of collider.
CharacterCollider Bool Whether an avatar should be prevented from moving into the collider's volume.
IgnoreRaycasts Bool Whether an avatar's laser should be prevented from hitting the collider's volume.

Colliders also have a type which determines whether it interacts with other colliders:


Values
Name Value Description
NoCollision 0 As the name implies, no interaction happens.
Static 1 Interacts with other active colliders.
Trigger 2 Interacts with other active colliders and user locomotion. Trigger colliders also prevent the avatar's laser from hitting the collider's volume, regardless of the IgnoreRaycasts setting.
StaticTrigger 3 Behaves the same as Trigger except it is more performant for non-moving objects.
StaticTriggerAuto 4 Behaves the same as StaticTrigger, but will automatically switch to Trigger if the object moves.
Active 5 Interacts with other static and trigger colliders, user body parts, user locomotion, and users in anchors. Such colliders are called "active" because they actively check every single frame for collisions with other things.
CharacterController 6 This allows a CharacterController to use the specified collider as its collision for physics based interactions (only the first of this type in a slot with a CharacterController on it will be chosen).
HapticTrigger 7 This is used to detect and trigger haptics events on the player.
HapticStaticTrigger 8 This is the same as HapticTrigger except it is more performant for non-moving objects.
HapticStaticTriggerAuto 9 This is the same as HapticStaticTrigger, but will automatically switch to HapticTrigger if the object moves.
HapticSampler 10 This is used in conjunction with the HapticPointSampler component in order to sample haptics events from a HapticVolume for debug purposes.


Note that active colliders do not cause collision events with other active collider types (possibly due to the computational costs involved).

MeshColliders are special cases. They only cause collision events with other primitive colliders (i.e. not other MeshColliders, again, possibly due to the computational costs involved), and the collision event fires only on the other collider.

Types of Collisions Table

Types of collisions
V 0.2 Static Trigger Active No Collision
Static X X X
Trigger X X X
Active X X
User Body Part X X X
User Locomotion X X
Mesh X X X X
Mesh (active) X X
User in Anchor X X X

Note that if a user is in No Clip locomotion mode, it means the user will not cause collision events with anything. This can be useful for "ghosting" through a world without causing interactions with anything.

See Also