How to get the transform of the camera for line trace
I'm trying to get the start position of my line trace to be attached to the player camera. I have code setup that gets the rotation of the line cast, but its start position is relative to world coordinates rather than the camera's.
My assumption is that PlayerCamera->GetComponentTransform() is the problem, but I don't know why or how. I've also tried PlayerCamera->GetSocketTransform(TEXT("PlayerCamera")), and the result was the same.
Here is a GIF of what's going on. As you can see the Start position is at world space. How do I make it local space to the camera? https://gyazo.com/39ad98b5bbfc7a1fcdda012cbf226e45
Thanks in advance to anyone who can help.
asked May 02 '18 at 07:23 PM in C++ Programming
I found the Answer.
The trace now starts at the camera. Start did need to be added to the end variable. So thanks to xSheim as I wouldn't have know to do that.
answered May 02 '18 at 07:50 PM
answered May 02 '18 at 07:27 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here