How CurrentForwardSpeed Works?

I think this will be a simple question for most of you.
I’m looking at the C++ Flying template, and inside of the pawn code I see code like this:

CurrentForwardSpeed = FMath::Clamp(NewForwardSpeed, MinSpeed, MaxSpeed);

I think I’m missing the basics of how the code is structured. Is CurrentForwardSpeed a built in variable of the Actor class that’s being overwritten? is that how the engine knows what the new Forward speed is?

The reason I’m asking is because I’m just trying to do simple manipulations such as, add vertical and horizontal thrusts.

CurrentForwardSpeed is not built in, but rather defined by the particular subclass of APawn you’re viewing currently. Every Tick, it is used to calculate an FVector identified as LocalMove that is passed to AddActorLocalOffset (which is a built-in method of AActor). That will then cause the engine to move the pawn at its current speed.

The FMath::Clamp function you referenced is used to set upper and lower bounds on the current speed, i.e. so the pawn can’t move any faster or slower than MaxSpeed and MinSpeed respectively.