How Can I prevent Controlled Pawns from Being Deleted On Reset?

JoeProgram
Fri, 05 May 2023 13:25:02 +0000
Programming & Scripting

I’m working a local multiplayer game. At the end of the round, I’d like to reset it so players are ready to play again. I’m using the Reset Level node and the OnReset event.

I’m seeing two things happen when I reset the level:

1. Any pawn possessed by a player controller is deleted

2. The camera changes

For example, if I have 4 player controllers that each possess a pawn, all 4 pawns are deleted OnReset

WTF Is? Reset Level in Unreal Engine 4 ( UE4 )

In Mathew Wadstein’s video on this, he calls out a similar, but subtly different behavior:
He notes the issue that any player pawn spawned in by the player start will be deleted. However, my pawns are not spawned in by player starts - they are in the level directly.

In the comments section to that video, devs say they’ve worked around this by spawning a default pawn, having the player controller possess that, resetting the level, then restoring the original connection. So far, that hasn’t worked for me - the berry is still deleted when this blueprint code is run.

Any advice on how I can keep these pawns from being deleted OnReset?

5 posts - 1 participant