So here i have the script to move my model to a position...
thing = workspace.Tornado
thing:MoveTo(Vector3.new(0,0,0))
...But how can i make it so it "floats" or "glides" to that position, rather than just teleport to that position?
So here i have the script to move my model to a position...
thing = workspace.Tornado
thing:MoveTo(Vector3.new(0,0,0))
...But how can i make it so it "floats" or "glides" to that position, rather than just teleport to that position?
Your best bet would be to use a For loop.
For example,
for i = 1, 20 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(.2, 0, 0)
wait()
end
This, in a script parented to the part, will move the parent brick 1/5 of a stud every ~1/30th of a second, 20 times. Thus, moving the part 8 studs.
If you're looking to only use Vector3 values, here is another example.
for i = 1, 20 do
script.Parent.Position = script.Parent.Position + Vector3.new(.2, 0, 0)
wait()
end
Same script.
Hopefully my overuse of examples explains this well.
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
I would personally use the lerp function.
Thanks
Wait no actually it doesn't work?
I set up an opensource place on my alt. https://www.roblox.com/games/166530798/-