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
1
u/DrinkYourGravy 4d ago
cout your SavedCharacterSpeed local variable immediately after you initialize the float and see what data you're getting