Search Unity

SceneManager is turning my brains inside out!

Discussion in 'Scripting' started by kingas, Jun 22, 2018.

  1. kingas

    kingas

    Joined:
    Jun 22, 2018
    Posts:
    2
    So I just made my first game and during the process I used SceneManager to reload a scene. BUT, it only worked when I put it into an object called "GameManager" and a script of the same name, it didn't when I just put it somewhere into the "Player" object's code. Why is that?

    btw, when I was doing the thing with the player object, I got an error called something like "could not find source at assets/scripts/SceneManager.cs".
     
  2. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
    Without seeing your code, it's hard to say what you are doing.
     
  4. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,531
    What is 'GameManager', what is 'Player'?

    These are not unity types, we did not write your code, you must define these things for us to understand them.

    See my signature:
     
  5. kingas

    kingas

    Joined:
    Jun 22, 2018
    Posts:
    2
    Damn, you got me... But, I did say what "Player" and "GameManager" are, they are object names.
     
  6. Stevens-R-Miller

    Stevens-R-Miller

    Joined:
    Oct 20, 2017
    Posts:
    676
    Yes, posting the code you're actually using would make it much easier to try to help you. Best guess I have from what you've said so far is that the
    GameManager
    is loaded, so it can call
    SceneManager
    methods, but the
    Player
    is not loaded, so it can't.
     
  7. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,531
    Damn, you got me.

    I have the answer to your problem sitting right here, I'm just not giving it to you because I want you to jump through hoops.
     
  8. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,521
    You've provided no useful context. Post some code or we're all just guessing whats wrong which is a waste of our time since you can easily provide code.