Made With Unity | Unity VR Part 5: XR Simple Interactable

Rehtse Studio
2 min readJun 10, 2022

The XR Simple Interactable on the XR Interaction Toolkit is the simplest version to interact with a object, we are going to use it to interact with a simple “Button”.

BUTTON

On the scene I have a object called ButtonFrame, that has a Rigidbody component, a Box Collider and a custom script called ButtonBehavior. Has a child object I have another game object called Button that has a Mesh Collider component with Convex and Is Triger check.

The Button object is the one with the XR Simple Interactable script and is Interaction Layer Mask is Button. The Hover event will called the public method from the ButtonBehaviour script when you touch the Button.

XR Origin / Player

Make sure both on your hands, LeftHand Controller and RightHand Controller, have the XR Direct Interact component and the appropriate Interaction Layer Mask is selected, remember that the Button object has the Interaction Layer Mask as Button

Also check that the collider from your hands is Trigger is checked.

Press Play

🎮PART 6🎮

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Rehtse Studio
Rehtse Studio

Written by Rehtse Studio

Game Developer sharing content around Unity, programing and tips and tricks in game dev.

No responses yet

Write a response