How to get real camera position in VR mode?

Hi there,

I’m doing some line traces in VR which should start at the position of the camera (shifted 10 cm downwards, so I can still still the line). This is my current setup:

http://i.imgur.com/jbWbATa.png

As you can see, this works as expected in non-VR:

http://i.imgur.com/bJzPKhN.png

In VR however, the starting position of the trace is wandering across the screen when I move the HMD in space:

http://i.imgur.com/U0HgpHS.jpg

(Using standalone game mode in 4.8 due to broken VR preview)

There is a new node called “enable player camera manager follow HMD”. But both values (orientation/position) are already set to TRUE (which seems to be there default).

But it seems that the camera manager does indeed not give you the current camera position ?

So I was hoping, that I could just add the result of ‘getOrientationAndPosition’, but that doesn’t help as you can see.

So here’s my question: How to get the real, absolute transform (position + orientation) of the camera in VR?

Thank you.

Come on, is it really so hard…? :wink:

Ok, thanks to Chillybody at the Unreal Forum there is a solution now to get the real (!) transform of the in-game camera (cameraManager doesn’t work reliable with VR):

http://i.imgur.com/xsqgGZp.png

(Slightly modified)

Hey there spyro,

Thank you for your work! This is exactly what I need and have been looking for a while.

Just one question: exactly where is that Blueprint? I mean, which actor has it?

Thank you so much again!

Hi there,

there are not internal dependencies so you can just pack this into a function library and use it globally in your project in every Blueprint.