I’m currently attempting to create arms for my shooter game. I’d like to make my arms move similarly to the game Kat. As you can see, the arms move fluently when you turn. They continue moving after you stop and then come back to the middle (similar to the Back easingStyle)
I’ve heard that this can be achieved with springs, but I’m not sure of anything else.
If anyone knows how to create this effect, please let me know! Thank you.
But how do I make it look smooth? As you can see in the clip, the gun lags behind a bit and perfectly conserves the appropriate amount of momentum when I stop moving my camera.
Using lerping would result in the loss of that affect. Unless you had a different way to use lerping in mind.
I’d love to use springs, as those are physics based. I’m just not sure.
Basically have the gun increment higher than the arms, making the arms move faster than the gun, but I haven’t learned how viewmodel arms works, so I could be wrong.
Here it is: ViewmodelMC.rbxm (11.3 KB)
Here’s the most relevant code too:
RunService.RenderStepped:Connect(function()
-- Bob arm when walking
if CurrentlyBobbing then
local BobTime = tick() * BobbingSpeed
local yOffset = math.sin(BobTime) * BobbingAmount
Camera.CFrame = Camera.CFrame * CFrame.new(0, yOffset, 0)
end
-- Move arm when rotating camera
local MouseDelta = UserInputService:GetMouseDelta()
Camera.CFrame = Camera.CFrame * CFrame.Angles(MouseDelta.Y/RotoBobbingDampener, MouseDelta.X/RotoBobbingDampener, 0)
-- Smoothly return arm to main position
local NewTween = TweenService:Create(Camera, TweenInfo.new(1), {CFrame = CameraPos})
NewTween:Play()
end)
I’m not really worried about people stealing this since it’s mainly local anyway so yeah… Also some of the code there is slightly bad. Probably needs to be changed a lot for it to not need ViewportFrames.
Thank you!
However, I’m not sure how I could convert this to a viewmodel.
I apologize, I know that I’m asking a lot. However, if you know how to convert this to work with this model, please let me know!