Which are the differents between UPawnMovementComponent and UFloatingPawnMovement?

I’ve just started to learn C++ and I’m going to create my own Pawn Movement controller but I have found that I can inherit from other classes than also inherit from UPawnMovementComponent.

One of them is UFloatingPawnMovement but I can’t find any information about what this class makes different from UPawnMovementComponent or for what purpose or in which cases it would be used.

Which are the differents between UPawnMovementComponent and UFloatingPawnMovement?

The main difference is that gravity is not implemented in UFloatingPawnMovement.

In situations like this, visit the official documentation and look at what the different classes have to offer.

You can also take a look at these in the engine code. There’s usually some decent documentation explaining the functionality of classes and functions.

Take a look especially at what the child overrides from the parent.

Thanks.

Yes, I have visited the official documentation and read it but it doesn’t tell the motivation to create a subclass. I’ve found that there is a Deceleration property and gravitiy is not implemented, but it doesn’t tell the motivation to call it Floating.

Thanks again.

Ideally naming is self documenting, meaning that ideally something named “FloatingMovementComponent” is the perfect choice for a movement component for a pawn that is floating, such as a spaceship.

Looking at the documentation for FloatingMovementComponent a bit, there are a couple of added variables that makes sense if we imagine we’re making a spaceship or something. If you want to get a deeper understanding of why the child exists, try to investigate what ‘Acceleration’, ‘Deceleration’ and ‘Turning Boost’ are used for, for example.

1 Like

Thanks.

I’m developing an Arkanoid clone and I have doubts about if player’s paddle is a “floating” pawn.