Let's say I have two part
s in my game world: A
and B
at some position.
A.Position = Vector3.new(10, 0,10) B.Position = Vector3.new(-10 , 0, -10)
I also have another part
, myPart
at some position:
myPart.Position = Vector3.new(0,0,0)
I want myPart
to move from A to B and B to A and A to B and so on and so forth... but I have some restrictions:
(a) do not use wait()
. Under heavy load, wait()
does not wait
as much as intended. e.g. wait(0.1)
can sometimes end up waiting 0.15 or worse, leading to quite unpredictable behaviour, so I do not want to use it.
(b) use a custom path rather than a straight line path: I want to go from A to B and B to A by having myPart
move in a very simple zigzag motion while getting to its target.
How do I move myPart
from A to B and back (B to A) over and over again without using a wait()
and using a custom path? Maybe lerp
ing or using physics bodymover
s might be the answer. But I am not familiar with them enough to provide the desired behaviour. Could you please guide me forward as the wiki is not helpful.