HomeGuides
HomeGuidesLearn about the Immerse SDK installerLog In

Collision Detection

For the Touch UI input to work, we need to add colliders to each element that the user needs to engage with.

Rect Transform Collider

You can use any kind of collider for the collision detection, however we have created a Rect Transform Collider component that will aid in creating a Box Collider that will automatically resize to the extends of your UI elements.

A Rect Transform Collider componentA Rect Transform Collider component

A Rect Transform Collider component

Avatar Touch Trigger

The Avatar Touch Trigger component's purpose is to communicate collisions to attached components by sending the same messages that a regular UI click would.

An Avatar Touch Trigger componentAn Avatar Touch Trigger component

An Avatar Touch Trigger component

There are a number of options for filtering unwanted collisions and haptic feedback which are detailed below.

Description

Click Event

When to send the 'click' event

Ignore Backface Collision

Disallow colliders entering from the back face of the UI, based on the position and forwards vector of this object's Transform

Required Collider Name

Required GameObject name of the colliding object. Set to null/empty to bypass the check.

When using the included Avatar Prefabs you may want to set this to "IndexFinger_END" to only process fingertip pressses.

Enable Haptics

If true, will send a haptic pulse on the pointer click event

Haptic Amplitude

Amplitude of the haptic pulse

Haptic Duration

Duration of the haptic pulse