[C++] Get the camera look at vector.
Is this possible? For example, if I'm spawning an object and want it to move directly away from the camera. Is there a way to get this vector to set the objects velocity?
asked Mar 25 '14 at 06:11 PM in C++ Programming
You can convert a FRotator to a unit FVector using .Vector() like so:
This will be the direction the controller is facing, not necessarily directly away from the camera. If you wanted to make it move directly away from the camera, you would want to do this:
To obtain the current rotation of a UCameraComponent:
Then use the little snippet from the FPS Tutorial.
Follow this question
Once you sign in you will be able to subscribe for any updates here