# Add this inside the color_chaser class. # Moves the prop smoothly toward a target position # over 100 small steps. # note: prop_device exposes GetTransform() and # MoveTo() for real positional control. MoveToTarget(Target : vector3) : void = loop: CurrentTransform := MeshProp.GetTransform() CurrentPos := CurrentTransform.Translation # Stop when we are close enough (within 5 cm). Distance := distance(CurrentPos, Target) if (Distance < 5.0): break # Step 10 % of the remaining distance each tick. NewPos := Lerp(CurrentPos, Target, 0.1) NewTransform := transform{ Translation := NewPos, Rotation := CurrentTransform.Rotation, Scale := CurrentTransform.Scale } MeshProp.MoveTo(NewTransform, 0.01) # Wait one tick before the next step. Sleep(0.01)