How to limit mouse x and y or pitch and yaw of pawn look ?


I want to limit its movement in the mark area only
Animation
Currently it can move freely, no limitation

Code in the pawn
I can move my turret pawn with basic add yaw and pitch.
I can control the move sensitivity but how do i limit its movement like picture 1.
For now the turret is on air soon it will be attached to side of my space ship. Star citizen turret can be a reference.

In this game, when player press G, he will possess this turret pawn with player controller as target. Not sure if i should create a custom control for the turret.

Look into how Camera Manager works. It does it out of the box.

Do i need to add camera manager to turret or in player as well?

Technically there is no need to add it - you already have a default camera manager. But you can add your own to the player controller - it’s often more convenient this way.

Search arround the forums for more examples. YT has many tuts, a Google search will spit out too many answers, too.

1 Like