View Issue Details

IDProjectCategoryView StatusLast Update
0000315Gameplay + OpenGL[All Projects] Bugpublic2017-02-24 14:47
ReporterNash 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionnot fixable 
Summary0000315: Player's BeginPlay called twice when traveling between levels
DescriptionSee attached example. BeginPlay is being ran twice on the next level, when you exit the current level normally (not via IDCLEV). Open the console to see the message. Seems to behave the same whether the map is part of a hub or not.
TagsNo tags attached.

Relationships

Activities

Nash

Nash

2017-02-21 07:22

reporter  

aaaaaaaaaa.pk3 (363 bytes)
Graf Zahl

Graf Zahl

2017-02-22 15:20

administrator   ~0000704

That's because the map transition spawns a second, temporary player actor.

The thing is, I don't know if it's a good idea to disable the call for this temporary player.
Nash

Nash

2017-02-24 01:50

reporter   ~0000731

Would exposing a check to differentiate between the temporary actor and the real, playable actor be a good idea?
_mental_

_mental_

2017-02-24 02:49

developer   ~0000733

It's easier said than done because the first call during level change (with "dummy" player pawn) is the only one when new game is started.
In other words what call should trigger event callback, first or second?
Maybe there are other considerations but the mentioned one was enough to mark this issue with 'need more knowledge' label for me.
ZZYZX

ZZYZX

2017-02-24 04:42

reporter   ~0000738

I had to deal with this in PlayerEntered callback in my event system. You might use that instead for player initialization; it's guaranteed to only call once and on the final player (non-temporary).
Nash

Nash

2017-02-24 05:22

reporter   ~0000739

@ZZYZX: that seems like a viable alternative solution but it also has its share of bugs. Will make a separate ticket for it
Graf Zahl

Graf Zahl

2017-02-24 10:36

administrator   ~0000745

In general I strongly recommend not to rely on PlayerPawn.BeginPlay for anything.
If the issue with the event system is merely the GC I'll have to check that and possibly fix it - if not the event needs to be more reliable. Player spawning is quite messy due to the need to handle voodoo dolls. I can remember that I once added an internal function that gets called after the map is fully loaded to do something with the real player. I think that is where a callback needs to be inserted for custom initialization.

Issue History

Date Modified Username Field Change
2017-02-21 07:22 Nash New Issue
2017-02-21 07:22 Nash File Added: aaaaaaaaaa.pk3
2017-02-22 15:20 Graf Zahl Note Added: 0000704
2017-02-24 01:50 Nash Note Added: 0000731
2017-02-24 02:49 _mental_ Note Added: 0000733
2017-02-24 04:42 ZZYZX Note Added: 0000738
2017-02-24 05:22 Nash Note Added: 0000739
2017-02-24 10:36 Graf Zahl Note Added: 0000745
2017-02-24 14:47 Graf Zahl Status new => resolved
2017-02-24 14:47 Graf Zahl Resolution open => not fixable