Is it important?

I don’t understand why we would go through the trouble of using the distance function and resetting the start location.

My code looks like this, would this cause bugs?

Float DistanceMoved = CurrentLocation.X - StartLocation.X;

if ( DistanceMoved > StopPoint || DistanceMoved < 0)
{
Velocity = -Velocity;
}

How are you determining the case for moving in more than one axis? If you only plan moving in one direction then that looks fine though I would store StartLocation as a double instead of an FVector.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms