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.
  • Is this when starting directly in a scene, or just when entering the scene at any point in a running game?

    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.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • It is happening when entering the scene at any point in a running game.
    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
    image
  • I assume the start game schematic is only used in UI > Start Menu and not also called in the scene (e.g. via an Auto Machine)?

    How's the scene loaded from your UI scene?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Yes, the start schematic is only used in UI > Start Menu and as far as I know it's the only place is called in the scene.

    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...

    image
  • edited December 2022
    Hm, since this involves some custom stuff, I'll need a Unity test project to check things out.
    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.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited December 2022
    I did a test and even if I remove all the custom parts, leave the default game objects in the scene and start directly the game in that scene, the problem persist :(

    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.

    image

    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?
    Post edited by ChimpLogik on
  • Still - test project please :)
    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.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Much appreciated, it will take me a bit to reduce the project to a decent size and then I'll send it your way :)
Sign In or Register to comment.