'Roblox remove mesh from game
When I equip my pet I use this code (and it works fine):
local humanoidRootPart = character:WaitForChild('HumanoidRootPart')
local backpackItem = game.ReplicatedStorage.Meshes[pet.Name]:Clone()
backpackItem.Parent = game.Workspace
RunService.Stepped:Connect(function()
local location = humanoidRootPart.CFrame
backpackItem.CFrame = location * CFrame.new(2, 2, 3)
end)
This will add a mesh(pet) over the player shoulder. But if I add a new mesh this will go inside the other mesh. How can I remove the current mesh from the game? If I destroy all the meshes in the mesh folder they still show in the game.
for i,v in pairs(collectionInventory:GetChildren()) do
v:Destroy()
end
So anyone know how I can remove the current mesh hovering over the players shoulder before I add the new mesh?
Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
