I have a respawning function that is called after I destroy my pawn. After the respawn function called, I start a new function that cast to the pawn blueprint and I can see that the cast fail but I don’t understand why.
The destroy event is passing the pawn ref to ‘respawn player’, which waits, and then tries to read the class of what is on the garbage heap by now. Even if it didn’t wait, the old player is still probably in garbage collection.
Hi Thanks for the answer! I have change the way I’m respawning the character using the following docs: Respawning a Player Character | Unreal Engine 5.2 Documentation
Now it works fine. The delay I had was a hacky thing as I had an issue If I didn’t put it. Thanks for the extras information you gave!