Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Clone a model and have its position changed?

Asked by 2 years ago

Hello! I have made a short script that every 12 seconds should clone a model, however, the clone should be placed in a different position (z co-ordinate + 334.464) this is so that the model - which is a hallway can be infinitely long. I calculated that if i added on 334.464 to the original position it should be inline. Any ideas on how to go about doing this. I have so far:

while true do
    wait(12)
    local infgen = script.Parent.original:Clone()
    infgen.Name = "notorig"
    infgen:MoveTo(Vector3.zAxis == Vector3.zAxis + 334.464)
    infgen.Parent = game.Workspace
end

To clarify, the script above does not work. Also, i dont want the player to see the model moving. This maybe a simple error but i am extremely tired! Thanks for the help in advance!

0
well the parent should be defined first before you try to move the part abelgetachew19 -10 — 2y
1
You're going to want to use a PrimaryPart for this model, and then access the model and use :SetPrimaryPartCFrame, and then use a CFrame value instead of a Vector value. The reason for this is because when you use :MoveTo(), it checks for collisions. Frometa1998 35 — 2y

Answer this question