How can I access the main camera's forward vector and set that to the player's forward direction

I’m trying to edit the starter third person controller blueprint, so that no matter which way the camera is facing, it’s forward direction will always determine the player’s forward direction. In this specific project, my camera isn’t tied to mouse control and will instead be controlled by something else. I’ve tried casting to the camera and using the GetActorForwardVector node, but it doesn’t seem to be working? Is this even possible with my current setup, or am I taking the wrong approach to this? (Sorry if this seems like a dumb question, Still learning the basics)

no matter which way the camera is facing, it’s forward direction will always determine the player’s forward direction

How close is this to what you need:

Thank you for the quick reply! I have tried the solution in the forum link that you provided, but no matter where the camera is in the scene, the player’s foward, and sideways directions remain the same as the direction that it was placed into the scene. Any ideas what could still be causing this? I’m happy to answer any further questions and provide any information needed.

It was not supposed to be the solution. I was asking whether it was the expected behaviour. Ensuring I understood the ask correctly.

It’s not entirely clear what is needed, are we moving along while rotating towards the camera’ fwd projected onto the floor? With cameras usually hanging above, using their fwd means moving the player into the ground, rather than along the surface. The movment comp can handle it gracefully enough but it may be inconsistent.

If the example demonstrates the intended behaviour and your did replicate the script, could you explain what is not working about it. The player is not moving, not rotating, moving in the wrong direction, rotating incorrectly?


Your original script is not working probably due to the Control Rotation of the player controller.

Either disable it and rotate the actor, or set new control rotation. Or perhaps you could produce an example of how you envisioned it?

Also, is the cast successful?

Sorry for the confusion, I didn’t quite understand what you were asking. On the bright side though, I did manage to get it working the way I intended it to, and I feel a bit stupid for even posting this question now :sweat_smile:. Turns out my original node setup shown in the picture above was exactly what I needed, I just wasn’t setting my camera variable correctly. The camera in my scene is a mostly stationary camera that will occasionally move and change it’s rotation based on where the player is on the map. So, for future reference, if anyone is looking for the same camera setup, the blueprint in the screenshot I posted will work just fine. Just don’t forget to properly set you camera variable. Thanks for all the help, and I really appreciate you taking the time to assist me.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.