I have some code that uses a tween to teleport the viewmodel to a the camera’s CFrame position over the space of 0.025 seconds.
For some reason, the viewmodel disappears when the player is not moving their camera. Can anyone help with this?
My script:
local tweenInfo = TweenInfo.new(
0.025,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):Connect(function()
game.TweenService:Create(viewModel.Value, tweenInfo, {Value = workspace.CurrentCamera.CFrame}):Play()
end)
viewModel.Value:GetPropertyChangedSignal("Value"):Connect(function()
viewModel:SetPrimaryPartCFrame(viewModel.Value.Value)
end)
What it looks like in-game: