Search Unity

  1. Engage, network and learn at Unite Austin 2017, Oct 3 - 5. Get your ticket today!
    Dismiss Notice
  2. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  3. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  4. Unity 2017.1 is now released.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  6. Unity 2017.2 beta is now available for download.
    Dismiss Notice

Roll-a-ball Tutorial Q&A

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

  1. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    Our tutorials are set up to teach you the coding you need to know as you go along.

    There are many lessons in the learn site (unity3d.com/learn) that will help you learn the coding you need as well.
     
  2. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    The canvas is the size it's meant to be. Please see the various UI lessons in the Learn tab. The size of the canvas is 1 pixel == 1 unity unit, so it will appear very large when compared to the scene view. You are not really expected to view both at the same time and the UI can be turned off in the editor if it's distracting when working on scene objects.
     
  3. DreamBliss

    DreamBliss

    Joined:
    Jul 10, 2014
    Posts:
    7
    What about not seeing the text? I changed the color and positioned it above the player.

    Thank you for replying to all of our posts and keeping an eye on this.
     
  4. gopixus87_unity

    gopixus87_unity

    Joined:
    Sep 12, 2017
    Posts:
    3
    Hello,

    I'am trying to make this very basic tutorial and on 2 step i have a problem. When I'am press play and try to move ball with arrows on keyboard, nothing happen and appear message "Display 1 No cameras rendering" I have 2017.1.1f1 version of unity. There is my script code:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class PlayerController : MonoBehaviour {
    6.  
    7.     private Rigidbody rb;
    8.  
    9.     void Start ()
    10.     {
    11.         rb = GetComponent<Rigidbody> ();
    12.     }
    13.  
    14.     void FixedUpdate ()
    15.     {
    16.         float moveHorizontal = Input.GetAxis ("Horizontal");
    17.         float moveVertical = Input.GetAxis ("Vertical");
    18.  
    19.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    20.  
    21.         rb.AddForce (movement);
    22.     }
    23.  
    24. }
    25.  
    After 30 min of learning first problem not good :(
     
  5. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    The best work few when working in the UI is to swap the mode into 2D and to select the main canvas and "frame selected" (use the menu, use the F key while the cursor is in the scene view, or double click on the canvas in the hierarchy). This will show you the entire canvas and all of the UI elements.

    Does this help.
     
  6. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    If you have the errors "No Cameras Rendering" this means you might not have a camera or the camera is disabled.

    At this stage it might be easier to restart the tutorial.

    If you don't want to do that, you need to investigate whether you have a camera in your scene or if the camera has been disabled.
     
  7. mc3

    mc3

    Joined:
    Mar 27, 2016
    Posts:
    13
    I found the bouncy physic material through a tutorial when I googled bouncing ball unity ... that was cool. I was able to get the ball to bounce around better this way. Learned a bit about the .. was it friction.. although it was a little confusing how the max, average and minimum values calculated against each other.

    So I have it bouncing off the walls but I wanted to modify it in a way that it wouldn't let me. With the max value of 1, I wanted to give it a little boost when it hit the wall, say a value of 1.2. It would revert to 1.

    By detecting a collision, can I create this additional physics force easier? Or is there a workaround to the bouncy physics material method?
     
  8. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    IIRC a bouncy value of 1 will be 100% bouncy. EG: the ball will lose no energy. If you dropped a ball that had no drag (so no air resistance) with a bouncy material of 1, the ball should drop and then bounce back to the original height it dropped from. This would go on forever, as the system loses no energy. A bouncy material less than 1 returns some, but not all, or the energy. Experiment until you get it correct. Now, I can't remember what happens if you have the physic material on both the ball and the floor... I'm not remembering if this combined to ADD energy or not. You'll have to try it out!
     
  9. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    Maybe I'm misinterpreting what you are trying to do.

    Can you tell me from scratch what the desired final outcome is?
     
  10. gopixus87_unity

    gopixus87_unity

    Joined:
    Sep 12, 2017
    Posts:
    3
    I just install older version 5.6.3 and everythings looks better and works fine. I think is no diference from 5 to 2017 to noob like me so I wanna use 5.6.3.
     
  11. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    From my understanding of the technology - changing from 2017 to 5.6, should not fix a missing camera issue.

    If it _does_, can you submit a bug report?

    Now, if you were working on the project in 2017.x and reimported it into 5.6.x - there is the chance the re-import process may change something. If your project is now working as expected, try opening it in 2017.x and see if stays that way.

    It should.
     
  12. WildGiller

    WildGiller

    Joined:
    Sep 12, 2017
    Posts:
    2
    I am stuck at the "moving the player" in the C# script component of the tutorial.

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

    The above is entered as per the video and saved in the script.
    But when I go back to the Unity I'm getting a compiling error.
    "No MonoBehaviour Scripts in the file or their names do not match the file name"

    I am running Unity 2017.1.1f1

    [​IMG]
     
  13. Bakerfield

    Bakerfield

    Joined:
    Jul 2, 2017
    Posts:
    2
    Hello!

    Yes. When I updated Unity to version 5.6.3p1 and compiled the project again it worked fine. Maybe the older version had a bug. I am using Windows 10 pro 64 bit. My input device is a common Microsoft natural ergonomic keyboard 4000. No extras (other than a 3d connexion space navigator, which I suppose doesn't have anything to do with the game), no unusual or deprecated drivers.

    Like I said, all fine now, thanks!
     
  14. Big_Walt

    Big_Walt

    Joined:
    Sep 15, 2017
    Posts:
    1
    My current problem is that after building the app and executing the app my "count text" disappears and I go through the cubes without triggering them. here is the code.
    Capture.PNG
     
  15. GrimGriefer

    GrimGriefer

    Joined:
    Sep 16, 2017
    Posts:
    1
    I checked out a few of the video tutorials (love them! hope they continue to grow!) and started this tutorial straight from unity's launcher "Learn" tab, after downloading it. The first thing the tutorial tells you to do is to save the scene, however, the project is in some temp folder location and will not allow saving your scene in the same location it points you to, prompting an error popup that it must be saved to the asset folder. clicking the close unity button and then clicking "keep" button prompts me to save in Documents folder. I make a folder for the project in Documents and it seems to have relocated (or at least duplicated) the files in the temp folder to this new folder. After which I am now able to save the scene when I reloaded it from the Projects tab.

    I'm assuming your first attempt to save scene, when first launched from the unity "Learn" tab, points your default save location in a place not allowed, which confused me for a bit. It would be nice if it pointed you to the correct location when first launched.

    First time using the Learn section. Using Windows 10
     
  16. softwarepoet

    softwarepoet

    Joined:
    Jun 9, 2016
    Posts:
    1
    Thanks for the tutorial! Everything went great, until... Build for PC... It builds fine, but when I run it, the ball races to the upper-left corner. I tried the normal stuff: Cold Shutdown + Reboot, build again, and same result. The game plays fine inside the unity editor.

    What steps can I take to try to root cause the issue?
     
  17. AlfredvanRaal

    AlfredvanRaal

    Joined:
    Feb 27, 2017
    Posts:
    1
    How to stop fixed eye in the scene view

    am doing some tutorials to start working with Unity. I found a problem in the scene view. It very difficult to zoom and right the way i want to. The "zoom/eye" button got stuck (Zie image of the eye). I don't know how to deselect it. My mouse becomes an "eye" with four squares below it. Its very unhandy to get the view i want to.

    Hope someone can help me deselect this.
     

    Attached Files:

  18. brycenbfalzone

    brycenbfalzone

    Joined:
    Friday
    Posts:
    1
    Hi so for some reason every time I go to edit a script Virtual Studio starts. I don't think it's a big problem, but I can't open up two scripts because the second one doesn't connect to Unity. Also, I experienced some problems with not being able to change the ball's speed and it gave me errors saying that the script has two different formats or something. I can't also pull up the reference page on the Unity website. I guess my question is how do I get back to the original Script editor and if I can't do Virtual Studio work the same with Unity?
     
  19. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    You can go into the Unity Editor and under settings change your scripting editor to Monodevelop.

    At the time that these tutorials were created, the default code editor for Unity on Mac and Windows was Monodevelop. Now there are additional options, including Visual Studio. In VS, you can create a link between the code editor and the Unity documentation, but you will have to set this up yourself. Best, would be to google for the most recent way of doing this.

    Hope this helps!
     
  20. ninjalunchboxninja

    ninjalunchboxninja

    Joined:
    Yesterday
    Posts:
    1
    I wrote out the code in step two, set the speed value to 50, no errors, but the ball won't move. Can you tell me what's wrong?
    Code (CSharp):
    1. using System.Collections.Generic;
    2. using UnityEngine;
    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.     void FixedUpdate()
    15.     {
    16.         float moveHorizontal = Input.GetAxis ("Horizontal");
    17.         float moveVertical = Input.GetAxis ("Vertical");
    18.  
    19.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    20.  
    21.         rb.AddForce (movement * speed);
    22.  
    23.     }
    24. }
     
  21. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    I don't see any obvious issues with the code upon a quick scan...

    Do you have any errors in your console?

    Can you send us a screenshot of the GameObject?
     
  22. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    Is your script file named "NothingSelected.cs"? That's what is appears to be.

    Your script name should be the same as the class name.

    Your class name is "PlayerController" so your script name should be "PlayerController.cs".
     
  23. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    The "going through the cubes" issue may be related to tags. Go to your tags and layers panel and make sure that they are properly defined - I suspect they are missing. And then make sure that the tags are properly assigned to the prefabs.

    Can you give us any more information related to the UI text? I don't have enough information to suggest a fix.
     
  24. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    Odd - sounds like you are getting random input data from somewhere...

    Can you give us any more information?
     
  25. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,661
    The eye with 4 squares below it means you are in fly through mode. Usually is is only true when holding the right/context mouse button. This means you can use the wasd keys to fly through the scene.

    You can look this up in the manual for more information.

    You should be able to deselect that or not use the right mouse button.

    I assume you have restarted Unity and your machine and made sure that you are on the most recent version and all of that?