Weld makes me fly

How could i perfectly align the handle to the viewmodel placed in camera and how can i make myself stop flying

Video:

Code:

-- ToolScript
local Tool = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ViewModelManager = require(ReplicatedStorage.Managers:WaitForChild("ViewModelManager"))
local AnimationManager = require(ReplicatedStorage.Managers:WaitForChild("AnimationManager"))
local equip = workspace.Sons["1.6"]

local function weldParts(part0, part1)
	local weld = Instance.new("Weld")
	weld.Part0 = part0
	weld.Part1 = part1
	weld.C0 = part0.CFrame:ToObjectSpace(part1.CFrame) 
	weld.Parent = part0
	print("Weld created between", part0.Name, "and", part1.Name)
end

Tool.Equipped:Connect(function()
	ViewModelManager:DestroyViewModel()
	equip:Play()

	local ViewModel = ViewModelManager:CreateViewModel("VM_cartao")
	local animations = AnimationManager:LoadAnimations(ViewModel, { "Cartao" })
	animations.Cartao:Play()
	ViewModelManager:BindViewModel(ViewModel)

	
	local viewModelPart = ViewModel:FindFirstChild("Cart") 

	if viewModelPart then
		local toolHandle = Tool:FindFirstChild("Handle")
		if toolHandle then
			
			toolHandle.CFrame = viewModelPart.CFrame
			weldParts(toolHandle, viewModelPart)
		else
			print("Tool handle not found.")
		end
	else
		print("ViewModel part 'CartaoHandle' not found.")
	end
end)

Tool.Unequipped:Connect(function()
	ViewModelManager:RecreateDefaultViewModel()
end)

Make sure it’s not colliding with what it’s welded to, and make sure can collide is off.

1 Like

Tried already still did not work

Other than the properties of whatever your welding, there would be no real reason why it’s happening. Can you send a screenshot of the properties of what your welding?

Handle:

Mesh Im welding to:

Maybe the problem is the custom hand that you implimented?

ok and what could be the problem

Does the hand have Collison, if so then turn off collision?

1 Like

Did you figure it out? I am having the same issue

I added a bone to the part in blender, imported to studio and added rigid constraints

And it follows perfectly everything with no problems

I wanted to make a detection thing so this worked for me

1 Like