How to alter Lyra Sample so the player mesh doesn't disappear after calling Unposses() on LyraCharacter ?

Hi, im looking for pointers here - I’ve been trying to add Mounts/Vehicle Support to the Lyra Sample.

I was hoping to do it by simply calling Unposses() on LyraPawn, and Posses() on my custom Vehicle/Mount Pawn derived from Lyra Hero class. But when i do that the Player Character mesh on my pawn dissapears. I assume it’s due to the logic that mesh/avatar definition is somehow being hidden by a call OnUnposses() in LyraAbilitySystemComponent.

So my question is, what would be the best approach here? Should i edit ALyraPlayerController::OnUnPossess(), Or is there a cleaner/easier workflow approach to adding Mounts/Vehicles that i’m missing ?

Lyra character is different than the normal UE5 manequin/character (even if they look the same)

there is actually a base Lyra character with an invisible mesh which is used to animate a different visible mesh. (which can be male or female)

For example If the player or AI is shot down in a match, the skeletal mesh that was used in the match, the one that you can see, is disabled and replaced with another one that will play the “break to pieces” effect. While the core invisible character will still be there

Have no solution to your question but maybe the above can help

1 Like

Hi Karlik00,
I have made a possess of a vehicle, which works fine. I can control it.
But when I repossess my Lyra character, then I cannot control it. Steering is lost somehow.

How did you repossess your Lyra character ?
I guess I will have the same problem as you after I get this to work.

Hi there,

Have you found a solution for your issue?
It seems that unpossessing the player is automatically linked to the sequence of events triggered by the GA_Hero_Death. In theory, AFAIK, you should execute a built-in logic to restart your player character, adding all components listed in your active experience set.

I haven’t gone further in this feature of adding vehicles, but for sure Lyra is hard-coded in many ways.

I am watching this topic to see what other devs would recommend.

So, on the topic of mesh dissapearance on possess(). The best, and easiest way to fix that is to move stuff around in:

ULyraControllerComponent_CharacterParts::OnPossessedPawnChanged(APawn* OldPawn, APawn* NewPawn)

So it basically doesn’t call any logic on previous pawn, instead move that code to new pawn bit, so it updates all the cosmetics only on character that is being possessed.

No luck for now with losing controls, but it is not class or network related. It happens even if you posses and unpossess the same pawn locally. One clue i have to investigate is that PlayerState ASC is being uninitialized when pawn controller is null.

Second is as L.F.A Pointed out, to look into how spawning/respawning is being handled and try to compare what is not happening on unpossess that should be happening.

From what i’ve debugged, ability system is still active and has all abilites, so its either an issue of reinitialising mapping context actions, or something else entirely.