Dodgeball with Props: The Moving Target Tutorial
verse-library
# This is a "While Loop".
# In Fortnite terms: This is like a "Respawn Timer" that never ends.
# It keeps running forever until we stop it.
loop:
# Move from A to B
MoveTo(PointA, PointB)
# Move from B to A
MoveTo(PointB, PointA)
# This function handles the actual movement between two points.
MoveTo(From: vector, To: vector)<suspends>: void =
# Check if the target actually exists before trying to move it.
if (Target):
# This is the "Magic Line".
# It tells the prop to slide from 'From' to 'To' over time.
# It uses "Ease" which means it starts slow, speeds up, then slows down.
# Like a vehicle accelerating and braking.
Target.MoveToEase(To, MoveSpeed, ease_type.Linear, animation_mode.OneShot)
# Wait until the movement is finished before moving again.
# Without this, the target would teleport instantly.
# This is like waiting for the "Elimination" sound to finish before spawning the next wave.
Wait(1.0 / MoveSpeed)