Skip to content

Commit

Permalink
Swapped RefreshAbilityActorInfo for InitAbilityActorInfo
Browse files Browse the repository at this point in the history
Refresh should be used when updating things like AnimInstance, CharacterMovementComponent, etc in the ActorInfo.

> AvatarActor will be the same but we will look for new AnimInstance, MovementComponent, PlayerController, etc.

When we're possessing on the client, we're setting a new AvatarActor and therefor we really should be calling `InitAbilityActor()`. While `RefreshAbilityActorInfo()` seems to work okay, I don't know what unintended consequences may happen in more complex projects, especially when possessing different classes. It's best to use the functions as intended.
  • Loading branch information
tranek committed Dec 27, 2019
1 parent 5e1b7aa commit 831ec2e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ void AGDHeroCharacter::OnRep_PlayerState()
// Set the ASC for clients. Server does this in PossessedBy.
AbilitySystemComponent = Cast<UGDAbilitySystemComponent>(PS->GetAbilitySystemComponent());

// Refresh ASC Actor Info for clients. Server will be refreshed by its AI/PlayerController when it possesses a new Actor.
AbilitySystemComponent->RefreshAbilityActorInfo();
// Init ASC Actor Info for clients. Server will be refreshed by its AI/PlayerController when it possesses a new Actor.
AbilitySystemComponent->InitAbilityActorInfo(PS, this);

// Bind player input to the AbilitySystemComponent. Also called in SetupPlayerInputComponent because of a potential race condition.
BindASCInput();
Expand Down

0 comments on commit 831ec2e

Please sign in to comment.