how can I recreate the gun sway from PAYDAY: The Heist? i’m looking for this specific gun sway and i couldn’t find any that resembles this one… yes i use a viewmodel
a video of the sway i’m trying to recreate:
That is insurgency sway, you convert mouse delta into CFrame angles sway and then lerp it.
I’ve actually done this before.
They way I have it set up is ClientGun is the main Gun script
The “SetGunPosition” modules runs through each of it’s modules and calculates it’s CFrame offset
They all get added together at the end to set the gun’s final position.
For the gun swaying, I set an offset in “SetGunPosition.Rotation” module
Here’s how it looks in the explorer:
[image]
Here is the “Rotation” module’s code
local UIS = game:GetService("UserInputService")
local Camera = game.Worksp…
Back again, with yet another problem.
I found that I could make the viewmodel face towards mousedelta/200 and it works quite well.
The issue is, I cannot seem to reverse the sway, meaning that the sway goes reverse to where I look. So I if I were to look to the right, the gun would move to the left.
Example: https://www.youtube.com/watch?v=0p3-P2p--1E
Code:
local mult = 6;
local cfAng = CFrame.Angles
local sin = math.sin
function handler:update(deltaTime) --bind this to camera render loop…
1 Like
i see, thanks
characterlimitcharacterlimitcharacterlimit