FPS gun / camera sway

Not quite sure how to explain what i want however it is basically a sin wave with a peak to get natural movement.

Deadlines:

External Media

My game:

I have tried to figure this out myself and search on the DevForum however i have not found a post on the same matter.

Any help is appreciated!

(Not sure why the top link is not embedded)

I’m assuming you’re talking about how the camera moves when you walk. The way I do this is by making CFrame position and angles that describe the movement. I calculate the values in the CFrame as a function of how long you have been walking. I get the actual equation using desmos. You can make a parametric function to see what the movement will look like in 2d and adjust accordingly. I make it so that when you start moving you will have no displacement. (if t = 0, x = 0 and y = 0)

That i already did however i ment the gun sway, when u sprint it moves with a sin wave but at it’s lowest it stays there so it creates a more natural running effect. It is not so smooth as the normal sway effects

1 Like