I’m currently trying to figure out how to create an aim system like how games like Dead Space use it.
If you do not press a mouse button, you can rotate the camera freely around your character. If you move, it basically represents “Use Controller Rotation Yaw” as true. The player faces where the camera looks at, the player rotates with the camera.
Same applies, if you press and hold right mouse button, which puts you into Aim Mode.
Now, the basic setup I have, is only:
Right Mouse Button Pressed → Use Controller Rotation Yaw TRUE
Right Mouse Button Released → Use Controller Rotation Yaw FALSE
Pressing and holding RMB now results in my character rotation to the camera aim instantly and if i release the mouse button, the character rotates back to his movement direction noticeably.
How can I apply the same to the Use Controller Rotation Yaw TRUE state, so that the character won’t “insta-face” into this direction?
I’m not sure I understand what you’re trying to do. It sounds like you want the player character to face the direction of the camera at all times, aiming or not. This is effectively done by leaving the “Use Controller Rotation Yaw” turned on the entire time.
Are you trying to do something different with the rotation when aiming? Or just the zoom?
default state is aiming with character forward locked to camera forward
when you ** press right click** aiming is stopped and character is allowed to rotate in the direction of the movement while the camera continues to look forward
when you release right Click character goes back to aiming mode with the forward locked to the camera forward.
The Issue:
when you exit aiming mode your character rotates around freely turning to face the the direction you are moving in, but when you RE ENTER aim mode instead of you character smoothly turning to face in the direction of the camera it snaps to the camera view.
what i think causes it:
when you release the right click UseControllerRotation gets set to true immediately snapping your character to the camera view.
How i think you can fix it
What I think you want to do is FIRST align the character forward vector to the camera forward vector using an interpolate or a lerp THEN set UseControllerRotation to true so the character forward vector gets locked to the camera forward vector only AFTER they are aligned so no snap is noticeable. I’m sure you can use the DOT product of both vectors to compare when they are similar enough to each other to allow the camera lock. once i get home ill take a look and see if i can build a blueprint example to share here