When I pick up a part, I change the name of it to “Handle” so the player’s character will move its arm in the default tool position. However, when picking up a different part and dropping it, it disappears but the original one persists. I’m open to alternate ways of handling this pickup system but for now it is the easiest way for me to get the base idea of my game down. (also feel free to shame my horrid skills)
I would like to make it so the part is dropped out of your player’s hand and fall to the ground and not disappear. Simple.
Server Script
game.ReplicatedStorage.Remotes.EquipPart.OnServerEvent:Connect(function(player, part)
if player.Character:FindFirstChild("Holding") then
part.Parent = player.Character.Holding
part.Name = "Handle"
part.CanCollide = false
part.Anchored = false
end
end)
game.ReplicatedStorage.Remotes.DropPart.OnServerEvent:Connect(function(player, part)
if player.Character:FindFirstChild("Holding") then
local part = player.Character.Holding:FindFirstChild("Handle")
if part then
part.Name = part:GetAttribute("OriginalName")
part.CanCollide = true
part.Anchored = true
part.Parent = game.Workspace.Interactable
part.Position += part.CFrame.LookVector * 3
part.Anchored = false
end
end
end)
Client Script
if input.KeyCode == Enum.KeyCode.F then
if player.Character.Holding:FindFirstChild("Handle") then
game.ReplicatedStorage.Remotes.DropPart:FireServer(objectTarget)
elseif objectTarget:GetAttribute("Grabbable") == true and objectTarget ~= nil then
game.ReplicatedStorage.Remotes.EquipPart:FireServer(objectTarget)
end
end
So far, I’ve tried recreating the entire script and still persists, I’ve researched similar posts but nothing was related.
That didn’t help BUT I did find out it seems to occur once the part is unanchored. I added a wait to the unanchor part and it still disappears just later… (duh)
I know a few other alternate ways of pick up systems, what is it used for? Just so I can recommend you the best way.
(Also, I’m definitely not going to shame your amazing skills.)
Currently I’m creating a horror+puzzle game w/ my friend. It’ll be used for picking up items like keys and using them. Also some fun stuff to mess around with. Mostly just using this way because I cannot animate for crap.
Then inside the part, add a script that makes it so that when you click it it welds to the players hand, I can type it out for you if you want but it’ll take like 5-10 mins