We’re attempting to utilize seamless travel with our characters, which have an AbilitySystemComponent (UE 4.25). When seamless travel starts, FSeamlessTravelHandler renames the character (Line 5969 in world.cpp), which in turn unregisters all components.According to the documentation, (Components | Unreal Engine Documentation) unregistering a component should only keep the component from updating, simulating and rendering.
However, AbilitySystemComponent implements OnUnregister where it calls DestroyActiveState thereby removing all abilities. The result is that our character has no abilities once it has traveled.Is this a bug, or are we misunderstanding the intended use of unregister component? And if so, how do we keep the ability system component from clearing all abilities when seamlessly traveling?
Solution tried: comment out DestroyActiveState is not working
on one of my projects i just re spawn / reinitialise all abilities/inventory items after the server travel.
I do it on server side in AGameMode::HandleStartingNewPlayer_Implementation
At very least thanks for finding source of the problem, saved me a few hours. Can confirm that mindless removing of “DestroyActiveState” doesn’t help.
Going to follow the way of reinitialization of abilities as suggested below.
I’ve been dealing with the same issue for the past week.
A new PlayerState is going to be created and everything from the old PlayerState is being copied over, and the things that are intended to be copied are simple data and structs (So one couldn’t just copy the whole ASC, and reinitialization is virtually the only way).
My ASC’s owner is the PlayerState, and my init logic is in the Character’s OnRep_PlayerState. While everything is being auto reinitialized/ regranted, abilities couldn’t be triggered even when new ASCs are correctly paird with PlayerStates on both the server the autonomous proxies. I also tried adding this Lyra fix. Abilitiy Specs during TryActivateAbility were returning correct actorinfo, handle, etc.
I ultimately stumbled upon a brute force fix where adding a manual UnPossess and Possess call at the end of AGameMode::HandleSeamlessTravelPlayer fixed everything.