:Clone() Function not working

I’m working on a puzzle/horror game and there’s a part of the game where there’s a bunch of computers coming out of a hole in the wall and on a conveyor belt, however when I try to script this behavior no clones are made. Here’s the script I have in ServerScriptService :

while true do
	local ComputerCloner = game.Workspace.ComputerCloner
	local Clone = ComputerCloner:Clone()

	Clone.Parent = game.Workspace
	Clone.Position = Vector3.new(ComputerCloner.Position)
	Clone.CanCollide = true
	Clone.Anchored = false

	print("Computer Generated")

	wait(1)
end

For some reason the print function is working so I don’t know what’s happening.

Fairly this script works(i just tested it at empty baseplate). First of all is this local or server script? And where is it located?

Also if you want to spawn clone in parent Position you don’t need this line

Clone.Position = Vector3.new(ComputerCloner.Position)
1 Like

It’s a server script located in ServerScriptService


Well here i tested it with simple part. You are unanchoring clone, maybe it just spawn in some other object and get wiped out from map? Try remove line which unanchor object

1 Like

Wait, I just found out the solution. I replaced the line you told me was unnecessary with :

Clone.Position = ComputerCloner.Position

Thanks!

That’s kinda strange. Because i used your code for testing and also it don’t do anything fr. Oh wait nvm. You are cloning object first and then setting position, there is some delay between them anyways, so physics start working a bit quicker and when you set position object get wiped out from map ig. Alright, nice if this helped, good luck!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.