Cylinder Collider
Updated
Cylinder-shaped collision.
- Type
comp-cylinder-collider- Script class
CylinderColliderComponent- Per entity
- Several
- Version
- 2.0.0
Read about it in Rigid bodies and colliders: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
collision |
0 ≤ x ≤ 15, integer |
|
friction |
0 ≤ x ≤ 5 |
|
height |
0. |
|
offset |
||
offset.x |
- |
|
offset.y |
- |
|
offset.z |
- |
|
radius |
0. |
|
restitution |
0 ≤ x ≤ 1 |
|
rotation |
||
rotation.x |
||
rotation.y |
||
rotation.z |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
PhysicsCollider::collision-enterPhysicsCollider::collision-exitPhysicsCollider::intersection-enterPhysicsCollider::intersection-exit
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Jump pads and a high jumpThe player's Character Controller reports the sensor pads it walks into: a pad named Jump Pad launches it 4 m up, and E jumps higher than the built-in jump on Space.
Click the scene, then walk with WASD onto a green pad to be launched. Press E for a high jump and Space for the normal one. Drag to look around.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(CylinderColliderComponent); if (component) log(component.props);}