Part of World Components

VRC UI Shape

This script is used on a UI Canvas to make it and all ui components under it interactable. This is how you can make your own UI menus in VRChat that have the blue raycast laser.

How to Setup

  1. You will need to create a UI Canvas and child elements for your menu.
  2. Set the canvas to World Space. Screen Space and Camera Space will be following the camera and will not be interactable.
  3. Add the VRC_UIShape component to the GameObject with the Canvas.
  4. Change the layer of the canvas GameObject to something other than UI.
  5. Add a box collider and check the size.

Tips

  • The default layer for UI Canvas's is UI but this layer is not interactable.
  • The UIMenu layer will only be interactable when the player's in game menu is open.
  • There must be an Event System in the world for UI menus to work. Only one is needed in cases where you have multiple menus.
  • Unchecking "Send Navigation Events" in the Event System and ensuring Navigation is set to "None" on subcomponents should keep sliders/etc from moving when the player is walking around.
  • When inputting text into an Input Field, WASD keys will cause the player to walk/strafe. There's no known way of avoiding this.
  • The VRC_UIShape component will automatically add a box collider to the GameObject. If you want to walk through your menu, you should add your own collider and mark it as "IsTrigger".
  • This script is actually the key component in Player Tracking.

Reference