I am currently seeing a bug where at the start of the same level, the game spawns the player sometime once (as to be expected), sometime twice.
I am not quite sure what might have caused is since I didn't change the spawn setting in a while and I haven't found consistent repro steps, so it seems random.
Spawning the player if it's already spawned will destroy the previous game object, so I suspect that you have the same combatant twice in your player group and spawn the group.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
To be more precise this happens when going from the initial sceneA which contains UI elements onlyto sceneB which contains the ORK Game Starter and schematic.
This is how the StartGame schematic looks:
In the settings:
Clear actors = true
Clear prefabs = true
How's the scene loaded from your UI scene?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The scene in the UI is loaded through a button OnClick() function that points to a function:
UnityEngine.SceneManagement.SceneManager.LoadScene("scenName");
The scene that's loaded, is set dynamically and depending on the game's progression, it Instantiates during Awake() different prefabs, all containing the ORK Game Starter game object.
in the StartSchematic asset field I've tried with or without the StartGame schematic, but doesn't seem to make any difference and the problem remains in both scenarios...
You can reduce the project's size by deleting the Library folder - zip it up, upload it somewhere (e.g. dropbox) and send me the link to contact@orkframework.com.
Also, just as a heads up - the game starter is only used once, i.e. when first initializing ORK (in a running game). So if you'd later return to your UI scene and want to start the game again like that, the game starter will not work again and it's Start Game will also not be called.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
This might be relevant: I noticed that out of the 2 duplicate players, only one has a Mouse Controller component.
Maybe it's related but not long ago I actually posted a problem in the forum ( https://forum.orkframework.com/discussion/7827/ork-ui-remaining-after-loading-a-new-scene#latest ) involving the Mouse Controller component disappearing, which was solved by adding a Spawn schematic to the player Combatant unblocking the Player Control.
Maybe I can add a schematic in the Combatant's Init Schematic that checks if the Player already exists in the game before spawning it?
I'm testing probably hundreds of times each day and this doesn't happen for me.
The combatant that has the control component added is usually the player - the other combatant could e.g. be a 2nd party member.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!