Viewmodel issue with tools

Whenever I equip tools, they teleport me, or just falls into the ground, i don’t know how to fix this issue, because when spam equipping and unequipping the tool, you can noclip

Here is my part of the code where it welds and all of that

character.DescendantAdded:Connect(function(Obj)
	if Obj:IsA("Weld") and Obj.Name == "RightGrip" then
		task.wait()
		local NewWeld = Obj:Clone()
		NewWeld.Parent = Obj.Parent
		NewWeld.Part0 = ViewModel:FindFirstChild(Obj.Part0.Name)
		self.activeWelds[Obj] = NewWeld
		--Obj:GetPropertyChangedSignal("C0"):Connect(function()
		--	NewWeld.C0 = Obj.C0
		--end)
		Obj:Destroy()
	end
end)

make them all massless and not collidable with character collision group.

i’ve lready done this and it still teleports

is it problem of viewmodel or tool itself?
Try using that without viewmodel first

Viewmodel, I tried spam equipping without the viewmodel and i didn’t move an inch

Can you share demonstration of issue with us?

how do you even move viewmodel if such thing heppens?
Viewmodel has to be fully non colidable and adjust position in PreRender NO ANY WELDS TO A CHARACTER

Here is me equipping and unequipping the tool fast
sorry for the quality

What does it have to do with that?
Can’t you just copy entire item then?
You seem to be moving an actual model with a new weld instead of copy of said model

well i don’t want to clone my tool, since the server does some modifications on the tool, but i am just deleting a weld locally and making a new one

why don’t you just repurpose said weld instead of creating a new one?

I’ve already tried that and it didn’t work but i could try something

I tried something and it worked! Thank you all for the help!

Obj.Enabled = false
Obj.Part0 = ViewModel:FindFirstChild(Obj.Part0.Name)
task.wait()
Obj.Enabled = true
self.activeWelds[Obj] = Obj

Oh no it didn’t work, the client sees the weld, yeah, but for the server the tool falls into the void

Finally something worked

character.DescendantAdded:Connect(function(Obj)
		if Obj:IsA("Weld") and Obj.Name == "RightGrip" then
			for i = 1, 1 do
				local newMotor = Instance.new("Motor6D")
				newMotor.Name = "RightGrip"
				newMotor.Part0 = ViewModel:FindFirstChild(Obj.Part0.Name)
				newMotor.Part1 = Obj.Part1
				newMotor.C0 = Obj.C0
				newMotor.C1 = Obj.C1
				newMotor.Parent = newMotor.Part0
				local tool: Tool = Obj.Part1:FindFirstAncestorOfClass("Tool")
				if tool then
					local con = nil
					con = tool:GetPropertyChangedSignal("Grip"):Connect(function()
						if newMotor.Parent then
							newMotor.C1 = tool.Grip
						end
					end)
				end
				self.activeWelds[Obj] = newMotor
			end
			Obj:Destroy()
		end
	end)

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