Working out Relative/World Location for Line Trace for Objects

Hi Guys,

Currently, my project has a camera that can rotate around an object in the centre. I am using the Leap Motion plugin to aim a “line trace for objects”. The camera is on a spring arm around the middle object and the hand is always in front of the camera as a component of the camera.

At the starting location, the line trace works fine, however when the camera has been moved this screws up the location and rotation of the line trace (e.g. when 180 degrees from starting position the left and right/up and down are completely reversed.)

I think that this is due to the hand location/rotation being relative coordinates to the camera, and using world location/rotation from the camera.

We are getting the hand coordinates from the

This is my first time using Unreal so any advice would be appreciated :slight_smile:

I am using 4.7.3 source code on Windows.

38348e26fa9adf6481797f1db655745edb61dac8.jpeg

Thanks guys!

Did you try to combine the rotators of your active camera (getCameraManager–>getWorldRotation)?

Thanks for the reply, yes this screenshot doesn’t show that but I did have the active camera world rotation added to the relative bone position/orientation which gave me the same issue.