Hey guys I’m having some trouble with animation blueprints.
Basically, in my game, the player can swith between 4 characters.
When the characters spawn, they store a reference to their AI controller
when I change player, the current player gets its stored AI controller to possess it and the player control possesses the new player.
That all works fine, but I’m noticing some bugs with animation blueprint.
I managed to fix one already. Other bug:
If I crouch a character, then select another player, when I come back to this character he will stand up automatically.
Any ideas whats happening?
void AMainPlayerController::Crouch()
{
ACharacterBase* ControlledPawn = GetPawn<ACharacterBase>();
if (ControlledPawn)
{
if (ControlledPawn->bIsCrouched)
{
ControlledPawn->UnCrouch();
ControlledPawn->IsProne = false;
}
else
{
ControlledPawn->Crouch();
ControlledPawn->IsProne = false;
ControlledPawn->GetCharacterMovement()->MaxWalkSpeed = CachedMaxWalkSpeed;
}
}
}