So I'm trying to make this game where you "fold" a piece of paper and throw it into the ceiling and the first bit of my code isn't functioning. It's just changing the position and there is probably a better way of doing this.
--dump location is 37.65, 2.626, 7.11 --base position is 50.128, 4.991, -19.182 wait(3) script.Parent.Size = Vector3.new(0.75, 0.05, 0.35) wait(3) script.Parent.Position = Vector3.new(37.65, 2.626, 7.11) game.Workspace.darts.p2.a.Position = Vector3.new(50.128, 4.991, -19.182) game.Workspace.darts.p2.b.Position = Vector3.new(50.128, 5, -19.182)
I'm not sure what the wait() functions are for as they seem purposeless for what you're trying to do, but you probably either want to use a for loop or TweenService if you're trying to get it to fluidly move into a position rather than an abrupt teleport.
Depending on the object (such as a character), it is better to use CFrame, but changing something's position or orientation will suffice in general situations.
I'm not sure exactly what you're trying to do, but I would check out the earlier links I post above if you want to do some kind of movement. The way I would rewrite the current code you have to be more efficient would be as followed:
--// SETTINGS //-- local dump_pos = Vector3.new(37.65, 2.626, 7.11); local base_pos = Vector3.new(50.128, 4.991, -19.182); --// VARS //-- local darts = game.Workspace:WaitForChild("darts"); local part_2 = darts:WaitForChild("p2"); local a,b = part_2:WaitForChild("a"), part_2:WaitForChild("b"); --// CHANGE POS //-- wait(3); script.Parent.Position = dump_pos; wait(3); a.Position = base_pos; b.Position = Vector3.new(base_pos.X, base_pos.Y+ 0.009, base_pos.Z);
If this wasn't what you were looking for, then I apologize, as I didn't really understand the question. I hope it helped in some way though :)