- Home /
Strange Raycasting Behaviour in VR
Hi folks,
I'm getting some strange behaviour when Raycasting from an object that is attached to a SteamVR tracked controller.
It's best illustrated with a screenshot: https://ibb.co/ct7NKa
So the scene view shows the object at 0,0,0 and casting directly forward, whilst the game view shows what you see when looking through the HMD.
The strange part is, from my script attached to the object, when I do a Physics.Raycast from within the Update() function, the hit.point is as if the Ray was cast from 0,0,0 as in the scene view. However, when I do a Physics.Raycast from a VRTK_ControllerEvents.TriggerPressed event handler on the same script, the cast works as I would expect, as in the game view (confirmed by creating a sphere at hit.point).
It's like I'm diverging into two separate realities. Does anyone have any ideas for what might be causing this ?
Appreciative for any steer in the right direction.
Your answer
![](https://koobas.hobune.stream/wayback/20220612130352im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Object snapping to floor and other objects in VR 1 Answer
Get point in plane where the normal crosses a GameObject in local space 2 Answers
VR: Controller rotation delta along other axis 2 Answers
Adding curve to a frisbee in virtual reality 1 Answer
How do I get the Oculus Rift's headset's position and rotation? 1 Answer