ViewModel Issue

Hello, im making a flashlight for a horror game like the old one looks bad.
Im having issue with the brand new one that im using viewmodel for it.
When my camera attach to fakecamera the viewmodel follows the camera too.
Example:

code =

		Equip:Play()
		Equip.Stopped:Connect(function()

			Idle:Play()

		end)
		clone.PrimaryPart.CFrame = cam.CFrame

		local oldCamCF = CFrame.new()

		l = rs.RenderStepped:Connect(function()
			
			local newCamCF = clone.CameraBone.CFrame:ToObjectSpace(clone.HumanoidRootPart.CFrame)
			if oldCamCF then
				local _,_,z = newCamCF:ToOrientation()
				local x,y,_ = newCamCF:ToObjectSpace(oldCamCF):ToEulerAnglesXYZ()
				cam.CFrame = cam.CFrame * CFrame.Angles(x,y, -z)
			end

			oldCamCF = newCamCF
			clone.PrimaryPart.CFrame = cam.CFrame
		end)

If you can help, thanks so much.

You’re trying to make it so it doesn’t follow the camera?
I don’t really see any other problem.

2 Likes

its follow the camera but im trying to make like fps game that they don’t follow totally the camera while the fake camera is woking, its confusing but if you search some fps games like the reload animations the camera moves but not everything moves with the camera, but if you move the camera while reloading the viewmodel doesn’t follow the orientation totally its like its follow an origin. Its confusing i know.

example in the moon animator attach to part: