the issue involves a cloned tool in Roblox appearing misaligned (specifically below the player’s hand) after equipping and playing animations.
Welding:
function ViewModelManager:WeldTool(realTool, cloneTool)
local weld = Instance.new("Weld")
weld.Part0 = cloneTool
weld.Part1 = realTool:WaitForChild("Handle")
weld.C0 = CFrame.new()
weld.C1 = CFrame.new()
weld.Parent = cloneTool
end
Cloning and Playing anims:
Tool.Equipped:Connect(function()
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local ViewModel, Gunmodel = ViewModelManager:CreateViewModel("ViewModel", "Cart1")
local animations = AnimationManager:LoadAnimations(ViewModel, { "Cartao" })
animations.Cartao:Play()
ViewModelManager:WeldTool(Tool, Gunmodel)
ViewModelManager:BindViewModel(ViewModel, Gunmodel)
ViewModelManager:DisableRightGrip(Character)
end)
Verify Animation Alignment
If the tool aligns correctly initially but misaligns after playing an animation, the issue might be with the animations
Adjust Weld C0 and C1 Properties
The C0 and C1 properties of the weld determine the offset and rotation from the weld’s Part0 to Part1. Since you’re currently setting both to CFrame.new(), which means no offset or rotation, this might be why the cloned tool appears misaligned.