ShooterGame - Weapon sway

Hello everyone!
I have question related with ShooterGame example. Since there is no camera place in PlayerPawn, how can I do weapon/hands sway (lag) ?
I talking about that :

Since I’m beginner, I dont know much about scripting (only few things related with BluePrints).
Are you able to help me with that ?

Thank you!

This is one of those little things that may seem simple but can end up being pretty complicated. Those look like view model animation blends but it can be a few different things at the same time.

It might be worth mentioning that a viewmodel swaying system would probably worth some good money if one were to find itself on the market place.

I heard that it can be achieved by IK, but also I’m not sure how.

You can utilize the values of the current mouse movement for this. Standard settings for the mouse axis are accessible through the functions “Get Lookup” and “Get Turnrate”. Based on these values you can add a relative location to the weapon mesh. That way you get a very basic sway. It won’t be smooth though.

To make it smooth you will need to use something like FInterp To.

As wiNt said you can also achieve this via an IK system (to be specific: This isn’t IK but just direct bone manipulation). To do this you feed the values to your AnimGraph and rotate the bone of the right hand (or whatever hand your weapon is attached to) through the “Transform (Modify) Bone” node.