Search Unity

Create a reference to the player game object in Roll a Ball

Discussion in 'Getting Started' started by fuzzbuddy, Sep 21, 2017.

  1. fuzzbuddy

    fuzzbuddy

    Joined:
    Sep 20, 2017
    Posts:
    8
    Hi I'm stuck in tutorial 2:1 Moving the camera.
    I am trying to "create a reference to the player game object by dragging the player game object into the player slot in the camera controllers component."

    However, I don't see the same thing as the tutorial as where to drop this. (around 4.38 mins in)

    Please help.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Please make sure you have the same object selected in your Hierarchy as they do in the tutorial. The Inspector panel reflects whatever object is selected in Hierarchy. So if you have a different object selected, then of course you won't see the same properties in the Inspector.

    If that still doesn't solve it, then please post a screen shot (with the Camera object selected).
     
  3. fuzzbuddy

    fuzzbuddy

    Joined:
    Sep 20, 2017
    Posts:
    8
    Tutorial screen on the top. My screen on the bottom.
    Trying to drag "player" to Player none game object which I can't see, under camera controller bottom right on their screen.
    upload_2017-9-21_16-1-55.png
    upload_2017-9-21_16-2-29.png
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    OK, you have an error in your Camera Controller script. Because you're right: that script is not exposing a "Player" field. So either it doesn't have such a field, or that field is not public, or something in your project is not compiling (check the Console for errors), which prevents Unity from knowing anything at all about it.

    Incidentally, if I ever meet the bozo who made the roll-a-ball tutorial, I'm going to chastise him for not having users dock the Console into their window layout right away. Again and again I see newbies tripped up by this.

    Go to the Window menu, select the Console command at the bottom, and then dock the resulting Console tab prominently in your window layout. You need it. (I suggest putting it right below the Game view.) Watch that thing for errors, and when one pops up, double-click it to jump right to the location of the problem.
     
  5. fuzzbuddy

    fuzzbuddy

    Joined:
    Sep 20, 2017
    Posts:
    8
    Thanks JoeStrout!