Skip to content

Cone Collider

Updated

Cone-shaped collision, tip up.

Type
comp-cone-collider
Script class
ConeColliderComponent
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.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
collisionLayer 0 ≤ x ≤ 15, integer
friction 0 ≤ x ≤ 5
height 0.001 ≤ x ≤ 10000
offset
offset.x -10000 ≤ x ≤ 10000
offset.y -10000 ≤ x ≤ 10000
offset.z -10000 ≤ x ≤ 10000
radius 0.001 ≤ x ≤ 10000
restitution 0 ≤ x ≤ 1
rotation
rotation.x
rotation.y
rotation.z

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • PhysicsCollider::collision-enter
  • PhysicsCollider::collision-exit
  • PhysicsCollider::intersection-enter
  • PhysicsCollider::intersection-exit

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(ConeColliderComponent);
if (component) log(component.props);
}