I am currently developing a game and I’m creating a system where cloned parts drop onto the ground automatically, sort of like an automatic dropper in a tycoon game.
The issue is that the parts are just not appearing in the workspace, even though my output log says it does.
For reference, here is my code:
local replicatedstorage = game.ReplicatedStorage
local base = replicatedstorage.DropPart
while true do
local part = base:Clone()
part.Parent = game.Workspace
part.Position = game.Workspace.DropPoint.Position
print("Part spawned.")
wait(2.5)
end
I’ve tried looking everywhere, but I can’t find a good working solution.
The part should be anchored and CanCollide should be false. You could try printing the position of both the part you have cloned and the DropPoint part AFTER setting the position of the part and seeing how they compare? This could give you a clue as to what the issue is.
No need. The problem could be that if DropPart has CanCollide unchecked, it could be showing up in the workspace, but no clipping ground and disappearing in void
I just tried this and for some reason the output says that the cloned part’s start position is exactly the same as the DropPoint’s position. It’s like the cloned part randomly disappears or doesn’t exist, even though the output says otherwise.
Try checking in explorer to see if the part instance disappear. Since both parts are in the exactly same position, DropPart could not be falling at all.
As @MrChrys_keke mentioned, you can try making sure that CanCollide on the DropPart is set to true. If the DropPoint is the same size and shape as your DropPart and is not transparent, then it is possible the part is getting set to the correct position but is being masked by your DropPoint.
Or it could be that your DropPart has the transparency set to 1 making it so that you cannot see it when it is parented.
I would recommend using explorer and the move tool to see where exactly the part gets to when it is cloned. The move tool’s arrows will allow you to easily identify where the part is in the workspace, so you can see where the part goes.
Very weird… Are there no errors in the console and are you 100% sure the part attempting to be cloned from ReplicatedStorage exists in ReplicatedStorage where the script is expecting it to be?