Giter Site home page Giter Site logo

vrcontrollerhint's Introduction

VRControllerHint

Onboarding VR controllers by highlighting the buttons in Unity game engine.

Quickly add controller button Hints to your VR applications using this asset. It is independant of XR SDK and so it should work with OpenXR, Unity XR, Legacy VR including Oculus Integration and SteamVR.

Supported devices – Oculus Rift, Oculus Quest, HTC Vive, Microsoft MR.

Vrcontrollerhint.mp4

How to setup:

  1. Import the “Quick Outline” free asset from asset store: https://assetstore.unity.com/packages/tools/particles-effects/quick-outline-115488. This is already included in the repo.
  2. Drag and drop the “LeftControllers” and “RightControllers” prefabs as child of respective hand anchors of your XR Rig or Player.
  3. Add the component “ControllerButton.cs” on your XR Rig or Player.
  4. That’s it! You are good to go.

Unity XR – Demo Scene:

  • Refer the “ControllerHintDemo_UnityXR” scene under ‘Demo’ folder.
  • You need to install ‘XR Interaction Toolkit’ from the Package Manager to run this demo.

Oculus Integration – Where to add controller prefabs:

image

SteamVR – Where to add controller prefabs

image

ControllerButton.cs – Public Booleans:

  • isColor – if enabled, the matrial color of the respective buttons will change. By default, The material color will change to Yellow. If you want a custom color, go to VRControllerHint/Models/ColorMaterials folder. Select all materials and change to your desired material albedo color.
  • isHighlight – if enabled, the respective button will be highlighted with the quick outline shader.
  • isHighlightAnimate – if enabled, the Highlight outline width will animate.
  • isHaptics – if enabled, the respective controller will receive haptic vibrations

Scripts to call controller Hints:

Show a Controller Hint for a button:

ControllerButton.ShowButtonHint(ControllerButton.Hand.Left, ControllerButton.Buttons.Grip, "Click this button to grab the object");

Hide a Controller Hint for a button:

ControllerButton.HideButtonHint(ControllerButton.Hand.Left, ControllerButton.Buttons.Grip);

Show All Controller Hints:

ControllerButton.ShowAllHint(ControllerButton.Hand.Left);

Hide All Controller Hints:

ControllerButton.HideAllHint(ControllerButton.Hand.Left);

vrcontrollerhint's People

Contributors

knowercoder avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.