- Home /
Raycasting and HTC Vive.
How would I go about changing mouse raycasts to work with the Vive Controllers.
I have something like this
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 15))
{
if (hit.collider.gameObject.tag.Equals("UpButton") && Input.GetMouseButton(0))
{
} }
I have something like this now, not tested but I am sure its incorrect
var right = SteamVR_Controller.Input((int)rightController);
var left = SteamVR_Controller.Input((int)leftController);
if(right.GetPressDown(SteamVR_Controller.ButtonMask.Trigger))
{
if (Physics.Raycast(ray, out hit, 15))
{
Any help would be appreciated, completely new to the VR stuff.
Comment
Your answer
Follow this Question
Related Questions
Google Daydream Controller pick up objects 0 Answers
XRRayInteractor Offset Ray Direction 0 Answers
How do I make it know what it's hitting? 3 Answers
Detemine wich side of a cube was hit 1 Answer
raycast help need 2 Answers