Need help with viewmodel

So first a little background information: I use @Headstackk’s way of animating guns and replicating animations for the viewmodel.
But when i equip this happens:

The CameraSystem code:

function module:Update(dt)
	GunSystem.Events.Update:FireServer(CFrame.new(1,0.5,0) * CFrame.Angles(-math.asin((self.Mouse.Origin.p - self.Mouse.Hit.p).Unit.y),1.55,0), CFrame.new(-1,0.5,0) * CFrame.Angles(-math.asin((self.Mouse.Origin.p - self.Mouse.Hit.p).Unit.y),-1.55,0), CFrame.new(0,0,0) * CFrame.Angles(-math.asin((self.Mouse.Origin.p - self.Mouse.Hit.p).unit.y),0,0))
	
	self.VMSpring:shove(self.Camera.CFrame)
	
	local VMOffset = self.VMSpring:update(dt)
	
	self.VM.PrimaryPart.CFrame = self.Camera.CFrame * CFrame.new(0, -1.3, -1)
	
	if self.Character.Humanoid.Health >= 1 then
		self.VM.Torso["Right Shoulder"].Transform = self.Torso["Right Shoulder"].Transform
		self.VM.Torso["Left Shoulder"].Transform = self.Torso["Left Shoulder"].Transform
		
		if (self.Camera.CFrame.p - self.Camera.Focus.p).Magnitude <= 0.6 then
			self.CanAim = true
			self.VM.Parent = self.Camera

			if self.Character:FindFirstChildOfClass("Tool") ~= nil then
				self.Torso.ToolGrip.Part1 = nil
				self.VM.Torso.ToolGrip.Part1 = self.Character:FindFirstChildOfClass("Tool").BodyAttach
				self.VM.Torso.ToolGrip.C0 = self.VM.Torso.ToolGrip.C0 * CFrame.new(0,0,0)
			end
		else
			self.CanAim = false
			self.VM.Parent = nil

			if self.Character:FindFirstChildOfClass("Tool") ~= nil then
				self.VM.Torso.ToolGrip.Part1 = nil
				self.Torso.ToolGrip.Part1 = self.Character:FindFirstChildOfClass("Tool").BodyAttach
				self.Torso.ToolGrip.C0 = self.Torso.ToolGrip.C0 * CFrame.new(0,0,0)
			end
		end
	end
	
	--self.Character["Right Arm"].LocalTransparencyModifier = 0
	--self.Character["Left Arm"].LocalTransparencyModifier = 0
end

Would be nice if you could help!

Thanks!

Do the parts in the viewmodel have CanCollide turned off?

1 Like

Usually this happens with a humanoid in the view model if so use an animation controller instead.

1 Like

Tried animation controller but it still hapens

Yes, i have and the viewmodel has a own collision group

Comment out the CFrame line to see if the CFrame is causing the problem.

1 Like

So if you equip the gun it teleports you to the viewmodel

So is it causing the problem? Sounds weird if it happens every frame, it should teleport the view model to the primary part instead

1 Like

Idk maybe this helps:

Is everything in the viewmodel massless?

1 Like

It wasn’t but still dosn’t work

I think it’s anchoring char to the anchored view model via welds or Motor6D and why the char tps to the viewmodel

If you want first person view models that’s different than headstack which is third person and a different system which will need adjusting.

Should be something like this

Uhhh


Maybe something is wrong with the properties:
Screenshot (55)

this is probably the issue as when you go in first person, the viewmodel is in the camera but then disappears after u go back in a slight third person mode but i dont see anything that indicates the VM is a clone

so i’m thinking this is the issue because everytime the module updates, it will go backwards by -1 and below by 1.3 while it is transformed to the character’s torso joints

Tested everything and it still dosn’t work
EDIT: self.VM = script.ViewModel:Clone()

have you checked if the VM is welded to the baseplate or something

It’s not welded.
Screenshot (56)

And it’s still not working after i tried all my ideas
Edit: Fixed!