-
What do you want to achieve?
I want to tween my gun viewmodel so that the aimpart lines up with the camera so that my gun will be aimed down sights -
What is the issue?
I don’t want to use animations to do this, and I have tried tweening the position of the viewmodel while aligning it in renderstepped but it either doesn’t work at all or just moves the model instantly instead of tweening it -
What solutions have you tried so far?
basically everything on the devforum I could find
this is the renderstepped in my viewmodel module
RunService.RenderStepped:Connect(function(dt)
if currentViewmodel then
local Delta = game.UserInputService:GetMouseDelta()
local UpdatedSway = SwaySpring:update(dt)
local UpdatedBob = BobSpring:update(dt)
if not isAiming then
BobSpring:shove(Vector3.new(Bob(5), Bob(10), Bob(5)) / 10 * (Character.PrimaryPart.Velocity.Magnitude) / 10)
else
BobSpring:shove(Vector3.new(Bob(5), Bob(10), Bob(5)) / 100 * (Character.PrimaryPart.Velocity.Magnitude) / 10)
end
SwaySpring:shove(Vector3.new(-Delta.X/500, Delta.Y/500, 0))
--somehow tween gun
currentViewmodel:PivotTo(
workspace.CurrentCamera.CFrame *
CFrame.new(UpdatedSway.X, UpdatedSway.Y, 0) *
CFrame.new(UpdatedBob.X, UpdatedBob.Y, 0)
)
end
end)