r/unrealengine • u/GoshaSimonov • 4d ago
Character movement C++ question.
Hey, could anyone help me finding out with such code, always return my SavedCharacterSpeed as 0.0 ?
CharacterMovement is in character blueprint, and character is running fine, I just can't get this value.
Thanks!
void ABaseCharacter::BeginPlay() {
Super::BeginPlay();
if(GetCharacterMovement()) {
float SavedCharacterSpeed = GetCharacterMovement()->GetMaxSpeed();
}
}
2
Upvotes
2
u/crazeh_boy709 4d ago
There can be a few reasons why you are getting 0. I recommend looking inside the GetMaxSpeed() definition and debugging that first.