Search Unity

Roll-A-Ball Tutorial Issues

Discussion in 'Community Learning & Teaching' started by Natdanar22, Oct 30, 2014.

  1. Natdanar22

    Natdanar22

    Joined:
    Oct 30, 2014
    Posts:
    14
    Hi,
    I'm new to unity and I am probably posting in the wrong forum but I'm working on the roll a ball design and I seem to be stuck on the ''moving the camera'' portion of the tutorial where you move the player into the ''player'' slot under the camera controller component. My problem is the fact that I don't know how to create player slot to put the player in, in the camera controller component.

    Here is a screen shot of the tutorial where he adds the player to the player slot....
    Screenshot (3).png

    And here is my Unity screen as of now....


    Screenshot (2).png
    I know this is probably a stupid question but any help would be greatly appreciated.
     
  2. Natdanar22

    Natdanar22

    Joined:
    Oct 30, 2014
    Posts:
    14
    UPDATE

    I found a solution to my problem sorry for taking up your time!!
     
    OboShape likes this.
  3. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Good stuff you got it working :) nothing to be sorry about, i've done/still do the same, that's the whole purpose and joy of a forum ;)

    yeah to have variables / game objects and their values show in the inspector they have to be declared as 'public' to allow them to be shown in the inspector window part of the script component.
     
    Natdanar22 likes this.
  4. varyk

    varyk

    Joined:
    Nov 2, 2014
    Posts:
    1
    Hey guys, can one of you help me out with a detailed description of why there's no player slot? I'm stuck at the same point and can't find the right option to turn on or off. Thanks!
     
  5. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    hi Varyk,

    what script are you working on that requires a player slot? is it the CameraController.cs script?

    if its the CameraController script, ensure that you have the player gameobject declared as public just under where your main class is declared, like below.

    Code (CSharp):
    1. public GameObject player;
    this should have the desired result of showing the variable as public, therefore showing in the inspector window on the script component of the gameObject that this script is attached to.
     
  6. PoomaxFTW

    PoomaxFTW

    Joined:
    Jul 5, 2017
    Posts:
    1
    But it is Public and still nothing why?
     
  7. KingToto007

    KingToto007

    Joined:
    Sep 9, 2017
    Posts:
    1
    Have you added the ; at the end of the transform.position = player.transform.position + offset; because i added it and i found the player slot