get the camera rotation from character in a different blueprint

Hi Guys,

I want to use the camera rotation for my aiming of a weapon.

But i have weapon fire etc. in the weapon blueprint, and i dont know how i can acces the camera rotation from there. When i turn context sensitive off, i can get the camera, but " target(self) " seems to be not allowed and i dont know where to get it from.

Can Someone just say how i can get the camera rotation in a different Blueprint?

Have you tried Get player pawn, and get forward vector from that? This should give you the forward vector of the player character’s camera.

The only difference is that the camera may be less restricted that the controller’s rotation. You may have to get the player pawn, cast it to your player character class and then get the camera’s forward vector.

Hope this helps :slight_smile:

No, that doesnt help, sorry.

When i get the forward vector, i do not have a rotation, but a location. However, i tried out to get the actor rotation from player pawn and the projectile spawned.

The Projectile moves in the direction the player is facing, but that is not what, i want. I want it to be like in the first person template. that i can also look and and down and stuff.

So player rotation it is. There is a property to use controller rotation, if it’s not set you may not get the up down.

86472-usepawnrotation.png

Thank you, that helped very much.

Have a nice day !