Looking through here : https://docs.unrealengine.com/en-US/…nts/index.html
It recommend overriding GetMovementComponent function, and return a custom variable which is pointing at my custom class.
But, I was expecting to set a private variable like CharacterMovement=MyCustomMovement.
Even under the declaration GetCharacterMovement() is this:
/** Name of the CharacterMovement component. Use this name if you want to use a different class (with ObjectInitializer.SetDefaultSubobjectClass). */ static FName CharacterMovementComponentName;
Does this mean I can set CharacterMovementComponentName=‘MyCustomMovement’ inside MyCustomCharacter header file?
Which is the best/correct option here?
- Custom variable, override GetMovementComponent
- Set CharacterMovement=CustomMovement variable in my CustomCharacter header file
- Set CharacterMovementComponentName=‘MyCustomMovement’ variable in my CustomCharacter header file
I’m comfortable with the old UScript (though it has been many years and perhaps I’ve forgotten how it works), and langauges in general, but I’m new to C++, and I just want to make sure I’m approaching this correctly.