Weird lerp effect applied to viewmodel

  1. What do you want to achieve? Keep it simple and clear!

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

  4. I want to fix/remove this weird lerp effect applied to my viewmodel…

  5. A weird lerp effect is applied to my viewmodel and it is bothering me alot.

  6. I tried looking for solutions but only 2 persons had the same issue as me, which both didn’t work.

Here is my script.

local RS = game:GetService("RunService")
local cam = workspace.CurrentCamera

local plr = game.Players.LocalPlayer
local char = game.Players.LocalPlayer.Character
local hum = char.Humanoid



local viewmodel = game.ReplicatedStorage.ViewModels.SCPs.SCP096FP:Clone()
viewmodel.Name = "SCPviewmodel"
viewmodel.Parent = cam

local animator = viewmodel.AnimationController:WaitForChild("Animator")

local docileidleanim = script:WaitForChild("docileIdleAnim")
local docileidle = animator:LoadAnimation(docileidleanim)

plr.CameraMode = Enum.CameraMode.LockFirstPerson


hum.Died:Connect(function()
	viewmodel:Destroy()
end)

RS.RenderStepped:Connect(function(dt)
	viewmodel:PivotTo(
		cam.CFrame + Vector3.new(0,0,3)
	)
end)


docileidle:Play()

The + Vector3 operation you’re doing is in worldspace, meaning that it will always be offset by that vector regardless of orientation. I believe you meant to do * CFrame instead, where it will move the CFrame backward relative to itself by 3 studs.

local offset = CFrame.new(0, 0, 3)
RS.RenderStepped:Connect(function(dt)
	viewmodel:PivotTo(
		cam.CFrame * offset
	)
end)
2 Likes

Thank you so much, I never thought it would be because of that.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.