Hello devs! I want to make a system where there is a pile of autumn leaves and a proximity prompt. When the player press (trigger) the proximity prompt, the character should do an animation of picking up the leaves with a rake (tool) on the right hand.
The problem is that the tool is duplicated inside the character successfully but it’s ‘invisible’ and the animation doesn’t play. The tool is well attached to the character as you can see in the ToolGrip Plugin image.
**Hope I can get some help with this… **
IMAGES:
Invisible tool in character (but it’s “holding” it)
ToolGrip Plugin Image (the tool is attached to the character)
SCRIPTS:
LocalScript in StarterGUI
local groundAutumnLeavesFolder = workspace:WaitForChild("f_groundLeaves")
local player = game.Players.LocalPlayer
for i, v in pairs(groundAutumnLeavesFolder:GetChildren()) do
local prompt = v:WaitForChild("PromptPart")
prompt.ProximityPrompt.Triggered:Connect(function(playerWhoFiredPrompt)
local char = playerWhoFiredPrompt.Character or playerWhoFiredPrompt.CharacterAdded:Wait()
if char then
prompt.ProximityPrompt.Enabled = false
char:WaitForChild("Humanoid").WalkSpeed = 0
char:WaitForChild("Humanoid").JumpPower = 0
char.HumanoidRootPart.CFrame = prompt.CFrame
--start leaf animation
local animator = char:WaitForChild("Humanoid"):FindFirstChildOfClass("Animator")
local animToPlay = script:WaitForChild("LeafRakeAnim")
local animTrack = animator:LoadAnimation(animToPlay)
animTrack:Play()
--give rake tool
local rakeTool = script:WaitForChild("Leaf Rake")
rakeTool:Clone().Parent = char
end
end)
end
Notes: If I delete the rake tool line, the animation works perfect. I’ve tried to clone the tool from ServerStorage and ReplicatedStorage and doesn’t work too.