I currently have a script that makes it so my Interactor Line Visual only turns on when a button is pressed in code. I wanted to know if someone knew how to make it so it could also turn on automatically when hitting UI in the scene without having to press a button.
If you are referring to Canvas UI elements when you mention hitting UI in the scene, you can call GetTrackedDeviceModel to get the pointer id of the XRRayInteractor, and then pass that id to IsPointerOverGameObject.
You will need to update your TeleportController
behavior to serialize a reference to the XRUIInputModule
on the EventSystem GameObject in your scene or find it by casting the EventSystem.current
to that class.