Search Unity

Official Roll-a-ball Tutorial Q&A

Discussion in 'Community Learning & Teaching' started by Adam-Buckner, Apr 17, 2015.

  1. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Any chance you can post your player controller script please for a look.
    (remember to use code tags please, just to make it easier to read)
     
  2. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    the skybox settings should be under the Window > Lighting tab
    (top of that in the inspector i think)
     
  3. PaulGreninger

    PaulGreninger

    Joined:
    Feb 27, 2017
    Posts:
    7
    Thanks Adam for your last support in Moving the Camera. I didn't watch the video long enough to realize the ball and platform were supposed to spin if the Camera was a child of the player.

    Now having the same problem as post 220, that is, I don't see any player slot in the CameraCamera, except my code compiles with no error. Slightly different GUI from Roll a Ball tutorial-Moving the Camera, but I created the CameraController script in Assets, then moved it into Scripts. Console error say, "The associated script can not be loaded. Please fix any compile errors, and assign a valid script." Will attach the code. Thanks for your help.
     

    Attached Files:

  4. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
    Code looks ok Paul. Make sure it is attached to camera. If it is it should show up in the inspector for the camera.
    If you don't see the script listed as a component in the camera inspector then drag the script into the camera inspector and that should attach it. The player slot should be available then since it is declared as public in the script.
     
  5. PaulGreninger

    PaulGreninger

    Joined:
    Feb 27, 2017
    Posts:
    7
    This is in regards to post # 1254-1255. Thanks Ryeath for you help. I'm still having problems with the Players Slot not showing up on the Camera Controller of the Inspector. This is module Moving the Camera-Roll a Ball. The code compiles without errors.

    The error only show up after you modify the generic script for CameraController to the new script at the end of the video, which you already OKed. Still no Players Slot under Camera Controller of Inspector. The only place I could drag and drop the modified script was onto the CameraController box of the Camera Controller. The error ,"The associated script can not be loaded. Please fix any compile errors, and assign a valid script," still exists under Inspector. Please see the attached screen shot, and the code for CameraController if you are not Ryeath.
     

    Attached Files:

  6. CavernousLemur

    CavernousLemur

    Joined:
    Mar 15, 2017
    Posts:
    2
    Still having some trouble getting the ball to move. I've added the speed variable, and changed the speed variable in the inspector, but no input using either WASD or the directional keys gets the ball to move.
    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public class playerController : MonoBehaviour {
    7.  
    8.     public float speed;
    9.     private Rigidbody rb;
    10.  
    11.     void Start()
    12.     {
    13.         rb = GetComponent<Rigidbody>();
    14.         speed = 10;
    15.     }
    16.  
    17.     void fixedUpdate()
    18.     {
    19.         float moveHorizontal = Input.GetAxis("Horizontal");
    20.         float moveVertical = Input.GetAxis("Vertical");
    21.  
    22.         Vector3 movement = new Vector3(moveHorizontal, 0.0f , moveVertical);
    23.         rb.AddForce (movement * speed);
    24.     }
    25. }
    26.  
     
  7. PaulGreninger

    PaulGreninger

    Joined:
    Feb 27, 2017
    Posts:
    7
    OK CavernousLemur:
    Did you create the script, PlayerController, in the top (Assets) directory, and then move to scripts? I needs this to get the path.
     
  8. LaimisL

    LaimisL

    Joined:
    Mar 16, 2017
    Posts:
    1
    Hello I need a help !
    When i finished writing the text from tutorial i checked for errors and ,I hit the play button...
    The question is... how I can move my ball ?

    Here is the script.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class Player : MonoBehaviour {

    private Rigidbody rb;

    void Start ()
    {
    rb = GetComponent<Rigidbody> ();
    }

    void Fixedupdate ()
    {
    float movehorizontal = Input.GetAxis ("Horizonal");
    float movevertical = Input.GetAxis ("vertical");

    Vector3 movement = new Vector3 (movehorizontal, 0.0f ,movevertical);

    rb.AddForce (movement);
    }
     
  9. CavernousLemur

    CavernousLemur

    Joined:
    Mar 15, 2017
    Posts:
    2
    Sure did, still no movement.
     
  10. TaylorBa

    TaylorBa

    Joined:
    Mar 17, 2017
    Posts:
    1
    My finished build doesn't deactivate pickups upon collision. Everything else works, and the pickups behave correctly when the game is played inside Unity. Advice?

    (Sorry if this was already asked, it's a long thread.)
     
  11. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
    Hi Paul,

    I haven't been ignoring anyone, just got back from a camping trip.

    I hope you have resolved your issue by now, but if not I just noticed something in the images you posted which I think I missed earlier. Your CameraController class in the script does not have the 'a' in it.

    It says public class CamerController: MonoBehaviour. That could be the root cause of your issues.
     
    OboShape likes this.
  12. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
    Hi,

    If you still haven't resolved this, look at your FixedUpdate method. The 'F' needs to be capitalized.
     
    OboShape likes this.
  13. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
    If you are still having this issue, look at your FixedUpdate method, the 'U' needs to be capitalized.
    Typical writing style for methods is to capitalize all the first letters - FixedUpdate().

    edit: 'U' needs capitalized. fixed a typo in my reply
     
    Last edited: Mar 20, 2017
  14. nofun

    nofun

    Joined:
    Mar 20, 2017
    Posts:
    1
    Hi, nothing is happening when I press the keyboard to move the player sphere. Picture of my inspector and code attached.

    EDIT: Never mind, as you can see below, I had typed in "Fixedupdate" instead of "FixedUpdate"

    ballinspector.png

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class PlayerController : MonoBehaviour {
    6.  
    7.     public float speed;
    8.      
    9.     private Rigidbody rb;
    10.  
    11.     void Start ()
    12.     {
    13.         rb = GetComponent<Rigidbody>();
    14.     }
    15.  
    16.     void Fixedupdate()
    17.     {
    18.         float moveHorizontal = Input.GetAxis("Horizontal");
    19.         float moveVertical = Input.GetAxis("Vertical");
    20.      
    21.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    22.      
    23.         rb.AddForce (movement * speed);
    24.     }
    25. }
    26.  
     
    Last edited: Mar 20, 2017
  15. Molybdenum42

    Molybdenum42

    Joined:
    Mar 21, 2017
    Posts:
    1
    I am having the same issue. The in-editor Play Mode works fine, but once I build (Windows) and try the executable, the ball moves, but goes through the pickups without deactivating them or adding to the score.

    EDIT: I fixed it! Going off a previous reply, I tried simply restarting the Unity editor as I suspected the issue might be with tags (I had deleted one because I had misspelled it), and the restart removed said deleted tag from the list. I don't know why or how that tag messed things up as I had the prefabs tagged with the correct one, but I suppose these things are weird this way sometimes. Simply rebuilding once I had closed the application and re-opened the scene was all it took, and now it works.
     
    Last edited: Mar 21, 2017
  16. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    [EDIT : Apologies, seen the solution a couple of posts down :(]
    Hi Paul,

    Just looking at your CameraController script.

    the class name in the script must match the file name of the script exactly.

    your script is named "CameraController.cs", however the class in the script is misspelled as "CamerController".
    Code (CSharp):
    1. public class CamerController : MonoBehaviour {
    if you rename the code to reflect the script file name, like below, you should be good to go.
    Code (CSharp):
    1. public class CameraController : MonoBehaviour {
    If not, remove and readd the script component.
     
  17. PaulGreninger

    PaulGreninger

    Joined:
    Feb 27, 2017
    Posts:
    7
    Thanks Ryeath, yes an "a" make all the difference. Sometimes you have scripts that I can download as a check, but on this one I did not see any in the transcript.

    My new problem. In Roll a Ball, Setting up the play area, my ball hits the wall, but then stops. The speed of the ball is reasonable, 200. I have uploaded screen shots of the wall, ground, and player. Also the player control script from the Unity tutorial that was previously blessed.
     

    Attached Files:

  18. marym1

    marym1

    Joined:
    Mar 22, 2017
    Posts:
    3
    Is there anywhere I can download the source code for this project? I am working in C#. Thanks!
     
  19. PaulGreninger

    PaulGreninger

    Joined:
    Feb 27, 2017
    Posts:
    7
    It just one code, but some C# scripts that are employed through Unity. You still have to work within the Unity platform. If you give me your email address I can send you a folder, that will almost get you through Setting up the Play Area.
     
    marym1 likes this.
  20. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
    That is a unique issue I haven't seen before. If I understand you correctly the ball rolls fine in all directions until it hits a wall, and then it won't roll again? I can't see anything in the pictures that would account for that action.

    200 seems really high for your speed. I have mine set to 10 for a reasonable speed, but at 200 it goes so fast it rolls right through the walls, exact opposite of what your reporting.

    Maybe check your box collider to be sure it's the same size as the wall, or maybe change size of the wall ( and collider to match) and move it to the middle of the plane and see if the ball can roll around it and if it still stops when contacting the wall. When I get into a situation like this my mind goes into troubleshooting mode and I first determine what works as planned and go step by step until I first notice errant behavior.
     
  21. dragonarrow1544

    dragonarrow1544

    Joined:
    Mar 23, 2017
    Posts:
    1
    Hi, I am working on improving this roll a ball project by adding new levels. I have read the earlier posts but didn't really get it, if you made a video that would help alot. Thanks!
     
  22. rdenisi

    rdenisi

    Joined:
    Mar 25, 2017
    Posts:
    1
    I have the same problem with the canvas, have you solved it?
     
  23. PaulPeterson

    PaulPeterson

    Joined:
    Mar 26, 2017
    Posts:
    2
    Hi,

    I just started tinkering with Unity this weekend. Not new to development, but new to this environment. I'm running into an issue in part 3, Moving the Camera. I entered the code as in the video:

    using UnityEngine;
    using System.Collections;

    public class CameraController : MonoBehaviour
    {

    public GameObject player;

    private Vector3 offset;

    void Start()
    {
    offset = transform.position - player.transform.position;
    }

    void LateUpdate()
    {
    transform.position = player.transform.position + offset;
    }
    }

    When I press play I get the following errors:
    "UnassignedReferenceException: The variable player of CameraController has not been assigned.
    You probably need to assign the player variable of the CameraController script in the inspector.
    CameraController.Start () (at Assets/Scripts/CameraController.cs:13)"

    "UnassignedReferenceException: The variable player of CameraController has not been assigned.
    You probably need to assign the player variable of the CameraController script in the inspector.
    CameraController.LateUpdate () (at Assets/Scripts/CameraController.cs:18)"
     
  24. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
    Paul,

    It sounds like you just need to drag your payer object from the hierarchy into the player slot on the camera inspector. This will assign the reference to the player object.

    You get two errors because you are using the reference twice, once to determine the offset, and once to move the camera.

    So highlight the camera so its inspector is open, drag the player sphere over the slot in the inspector that player.
     
  25. PaulPeterson

    PaulPeterson

    Joined:
    Mar 26, 2017
    Posts:
    2
    Thank you,

    Turns out my error was partly that, and partly that I created 2 scripts associated with the camera. I had dragged the player to one of the scripts, but not the second. After deleting the second script, it worked.

    Thanks again!
     
  26. marym1

    marym1

    Joined:
    Mar 22, 2017
    Posts:
    3
    Thanks for the offer Paul, but I'm all set now. I was able to fix my own problem.
     
  27. PaulGreninger

    PaulGreninger

    Joined:
    Feb 27, 2017
    Posts:
    7
    A new hire at work fixed the problem. He added a new Material under the folder Materials, and set the bouncyness to 0.5, then dragged the material onto the ball and the wall. I might say that this is no where in the tutorial. Why so? The material in the tutorial comes out as None(Physical Material). Using Unity 5.5.1f1 . What should be the size of the ground, and walls? I have 2x1x2, for the ground, and 0.5x2x20.5 for a wall, with speed 200.
     
  28. theoneandonly0542

    theoneandonly0542

    Joined:
    Mar 31, 2017
    Posts:
    1
    I am at video #3, where you get the camera to move with the player. But whenever I start, it gives me this error:
    Code (csharp):
    1. UnassignedReferenceException: The variable player of CameraController has not been assigned.
    2. You probably need to assign the player variable of the CameraController script in the inspector.
    3. CameraController.LateUpdate () (at Assets/Scripts/CameraController.cs:18)
    4.  
    . Here's my code:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class CameraController : MonoBehaviour {
    6.  
    7.     public GameObject player;
    8.  
    9.     private Vector3 offset;
    10.  
    11.     // Use this for initialization
    12.     void Start () {
    13.         offset = transform.position - player.transform.position;
    14.     }
    15.  
    16.     // Update is called once per frame
    17.     void LateUpdate () {
    18.         transform.position = player.transform.position + offset;
    19.     }
    20. }
    21.  
    . And here's a picture of my Inspector: https://drive.google.com/file/d/0B796xYPyFv3CTWVKMExiNXdyNFU/view?usp=sharing
     
  29. Deleted User

    Deleted User

    Guest

    It's probably a glitch of some kind. Try removing the script from the camera, save the project, reload it, reassign the script to the camera and add the player game object to the script.
     
  30. pdx_matthew

    pdx_matthew

    Joined:
    Apr 1, 2017
    Posts:
    2
    Hello!
    I'm just getting started with Unity ver 5.6.0f3 and am trying to follow along with the Roll a Ball project. When I create a new 3D project, I don't see the Main Camera or Directional Light icons in the scene:
    UnityScene1.png

    I've added the Plane object as well but no matter what I do it does not show up in the scene editor:
    UnityScreen2.png

    However, the Game tab does show the plane:
    UnityScreen3.png

    I am not sure what else to do. I presume this is due to the relationship between the camera's Transform settings and the plane's Transform settings, but I am not sure how to rectify the problem. I've reverted the layout to factory defaults on the off chance that I jammed something up accidentally, but no luck.

    Any input would be greatly appreciated!
    -Matthew
     
  31. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
    matthew,

    I tried duplicating your issue but wasn't able to. If you haven't got a resolution yet try posting this over in the editor forum. Might get a better response there.
     
  32. panoskal

    panoskal

    Joined:
    Mar 31, 2017
    Posts:
    28
    pdx_matthew - Here is an idea, click on the Layers menu (next to the Layout, top right corner) and make sure the option Everything is selected.
     
  33. pdx_matthew

    pdx_matthew

    Joined:
    Apr 1, 2017
    Posts:
    2
    Hi Ryeath and Panoskal,
    Thank you both for taking the time to help me! I did check that all of the layers in the project were selected as visible.

    I ended up resolving this (somehow) by continuing to fuss with the zoom and Frame Selected commands until eventually the playing surface was back in view.

    Thank you again! I appreciate that you took the time to reply. :)

    -Matthew
     
  34. careyduane

    careyduane

    Joined:
    Jun 16, 2015
    Posts:
    9
    Hello:
    I completed the Roll-A-Ball some time ago but I updated it for version 5.6 also instead of using the Keyboard for an input
    device I'm using the xbox Kinect sensor. I use the gestures lean left for the ball to go left, lean right for the ball to go
    right, lean forward for the ball to go forward, and lean backward for the ball to go backward. Also added a timer for the game to see how long it take to complete picking up all the cubes. I'll include a screenshot
     

    Attached Files:

  35. caci_

    caci_

    Joined:
    Apr 12, 2017
    Posts:
    2
    Hello there!
    Everything went just well following this tutorial, however when I got to test "You Win!" message, it came up right after I hit the first ball. Went over and over through the script, but couldn't find anything.
    Any ideas?
    Thank you so much!
     
  36. panoskal

    panoskal

    Joined:
    Mar 31, 2017
    Posts:
    28
    caci_ - Assuming you followed the tutorial and went through the script over and over again, I will pick something that could be easily missed. Maybe instead of writing "if (count >= 12)", you wrote "if (count <= 12)". What would help us see what went wrong would be pasting the whole code here. On the options above the place you are typing your replies there is one called insert... Make sure you pick it and then choose code and paste the code in there.
     
  37. WhatlsMyName

    WhatlsMyName

    Joined:
    Apr 14, 2017
    Posts:
    8
    Hello all,

    I've completed everything through 3.1 "Creating Collectible Objects" of the tutorial.

    Problem:
    In the center of the board, there's an invisible...something. When I hit play, the invisible object changes my ball position, increasing its Y position by .5. I couldn't figure out why that was happening until I rolled the ball around some in Play mode and saw the ball bounce off the invisible thing in the center of the ground plane.

    I've accounted for all the objects in the hierarchy, and all of them are set Active in the Inspector, so I don't know what it could be.

    Although the tutorial does tell us how to deactivate the pick up objects, I've checked my code and I don't think that's related because this thing is invisible all the time, even in the Scene View.

    I've moved other objects out of the way and dragged a selection around the center of the board; nothing's there.

    Nevertheless, when I hit Play, the ball shifts .5 positive in Y position, and it moves around the board floating at that increased height. When I turn on Use Gravity for the ball and start moving, it rolls off the edge of the invisible thing down onto the board, and if I try to move the ball back to the center, it runs into this invisible thing like a wall.

    See attached 1.gif for an example of the issue. See UnityGUI.zip for screenshots of Inspector for all objects, hierarchy, scene view, and project area.

    My code:
    Code (CSharp):
    1. //CameraController.cs
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class CameraController : MonoBehaviour {
    6.  
    7.     public GameObject player;
    8.  
    9.     private Vector3 offset;
    10.  
    11.     // Use this for initialization
    12.     void Start () {
    13.         offset = transform.position - player.transform.position;
    14.     }
    15.    
    16.     // Update is called once per frame
    17.     void LateUpdate () {
    18.         transform.position = player.transform.position + offset;
    19.     }
    20. }
    21.  
    Code (CSharp):
    1. //Rotator.cs
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class Rotator : MonoBehaviour
    6. {
    7.  
    8.     // Update is called once per frame
    9.     void Update ()
    10.     {
    11.         transform.Rotate (new Vector3 (15, 30, 45) * Time.deltaTime);
    12.     }
    13. }
    Post 1 of 2
     

    Attached Files:

  38. WhatlsMyName

    WhatlsMyName

    Joined:
    Apr 14, 2017
    Posts:
    8
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PlayerController : MonoBehaviour
    5. {
    6.     public float speed;
    7.  
    8.     private Rigidbody rb;
    9.  
    10.     void Start()
    11.     {
    12.         rb = GetComponent<Rigidbody> ();
    13.     }
    14.  
    15.     void FixedUpdate()
    16.     {
    17.         float moveHorizontal = Input.GetAxis ("Horizontal");
    18.         float moveVertical = Input.GetAxis ("Vertical");
    19.  
    20.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    21.  
    22.         rb.AddForce (movement * speed);
    23.     }
    24.  
    25.     void OnTriggerEnter(Collider other)
    26.     {
    27.         if (other.gameObject.CompareTag ("Pick Up"))
    28.         {
    29.             other.gameObject.SetActive (false);
    30.         }
    31.     }
    32. }
    That's everything. Appreciate any help.
     
  39. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
    McGrudder,

    that is behaving like there is a rogue box collider hanging out at origin. Check all your objects and make sure nothing has an extra collider on it.
     
    WhatlsMyName likes this.
  40. WhatlsMyName

    WhatlsMyName

    Joined:
    Apr 14, 2017
    Posts:
    8
    That makes perfect sense, I didn't think of that.

    I won't be able to check it until Monday, but I'll post back the results.

    Thanks!
     
  41. wijmar12

    wijmar12

    Joined:
    Apr 16, 2017
    Posts:
    1
    i have a problem with Camera Controller Scripts when i write

    Public GameObject Player;

    Private Vector3 offset;

    GameObject and vector3 are missing ( no pop up )

    my unity version 5.5.0

    Screenshot_4.png
     
    Last edited by a moderator: Apr 19, 2017
  42. WhatlsMyName

    WhatlsMyName

    Joined:
    Apr 14, 2017
    Posts:
    8
    @Ryeath You were right; my Walls gameobject container in the hierarchy had a box collider at origin.

    REALLY surprised dragging a selection box around the origin doesn't select colliders, but now I know.

    SOLVED.
     
  43. caci_

    caci_

    Joined:
    Apr 12, 2017
    Posts:
    2
    Hey panoskal, thank you for your reply. When you mentioned the "if", I ran to it, but it's just as it should be. Well, at least, I think it is. Adding my code below.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. public class PlayerController : MonoBehaviour
    7.     {
    8.  
    9.     public float speed;
    10.     public Text countText;
    11.     public Text winText;
    12.  
    13.     private Rigidbody rb;
    14.     private int count;
    15.  
    16.     void Start ()
    17.     {
    18.         rb = GetComponent<Rigidbody>();
    19.         count = 0;
    20.         SetCountText ();
    21.         winText.text = "";
    22.  
    23.     }
    24.  
    25.     void FixedUpdate ()
    26.     {
    27.         float moveHorizontal = Input.GetAxis ("Horizontal");
    28.         float moveVertical = Input.GetAxis ("Vertical");
    29.  
    30.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    31.  
    32.         rb.AddForce (movement * speed);
    33.     }
    34.  
    35.     void OnTriggerEnter(Collider other)
    36.     {
    37.         if (other.gameObject.CompareTag("Pick Up"))
    38.         {
    39.             other.gameObject.SetActive (false);
    40.             count = count + 1;
    41.             SetCountText ();
    42.         }
    43.      }
    44.     void SetCountText ()
    45.     {
    46.         countText.text = "Count: " + count.ToString ();
    47.         if (count >= 12);
    48.         {
    49.             winText.text = "You Win!";
    50.         }
    51.     }
    52. }
     
  44. WhatlsMyName

    WhatlsMyName

    Joined:
    Apr 14, 2017
    Posts:
    8
    @caci_ I'm no expert, and I haven't done this lesson yet, but I don't see in your code where your printing the score to the screen, so I was wondering if your issue has to do with where your print code is. Or are you testing this in the Console?
     
  45. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
    caci_,

    I'm not seeing anything that jumps out at me from your script. it all looks pretty good.

    Try making your count value public and then watching it in the inspector as you pick up your collectibles and see how it reacts. It should start at 0 and go up 1 every time you pick up an item.
     
  46. panoskal

    panoskal

    Joined:
    Mar 31, 2017
    Posts:
    28
    caci_,

    Okay, found your problem. Line 47, delete the semicolon ( ; ) after the if condition.
     
    caci_ and Ryeath like this.
  47. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
    Nice catch panoskal.
     
  48. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Cool!

     
  49. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I'm unclear how you arrived in a state with non-bouncy materials. The default state for materials in the default state of the editor should be a material that acts "normal" to collisions and does not absorb any of the force.

    It is possible to set a project up in a way where the physic material does not bounce at all, but this is not the default value. This is why physic materials are not discussed in the tutorial. They should behave correctly without user intervention. Somehow (experimenting?) you may have set something into a strange state.

     
  50. SOMEONEONTHEBLOCK

    SOMEONEONTHEBLOCK

    Joined:
    Apr 19, 2017
    Posts:
    2
    so I have been haveing an error this is the code I am using for the camera:

    using UnityEngine;
    using System.Collections;

    public class CameraController: MonoBehaviour {

    public GameObject player;

    private Vector3 offset;

    void Start ()
    {
    offset = transform.position - player.transform.position;
    }

    void LateUpdate ()
    {
    transform.position = player.transform.position + offset;
    }
    }
    here are some of the errors that I have got.
     

    Attached Files: