Viewmodel upside down

  1. I am trying to achieve a viewmodel script but I have encountered an issue.

  2. The issue here is that the viewmodel for some reason is upside down.

  3. I have tried looking for solutions on the devforum but I couldn’t find anything, I tried to fix it myself before but couldn’t find a solution.

Here is my viewmodel script:

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

local UIS = game:GetService("UserInputService")

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



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

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

local idleanim = script:WaitForChild("IdleAnim")
local idle = animator:LoadAnimation(idleanim)

cam.CameraSubject = plr.Character:WaitForChild("Humanoid")


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

local offset = CFrame.new(0, 0, -1.5)

RS.RenderStepped:Connect(function(dt)
	
	
	viewmodel:PivotTo(
		cam.CFrame * offset
	)
end)


--loop variables
local idleuse = true


idle:Play()


Found out the issue

Had to replace

viewmodel:PivotTo(
		cam.CFrame * offset
	)

by

viewmodel.PrimaryPart.CFrame = cam.CFrame * offset

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