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 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 component

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

Click EventWhen to send the 'click' event
Ignore Backface CollisionDisallow colliders entering from the back face of the UI, based on the position and forwards vector of this object's Transform
Required Collider NameRequired 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 HapticsIf true, will send a haptic pulse on the pointer click event
Haptic AmplitudeAmplitude of the haptic pulse
Haptic DurationDuration of the haptic pulse