Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Roll-a-ball Tutorial Q&A

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

  1. Djennosa65

    Djennosa65

    Joined:
    Jul 3, 2015
    Posts:
    5
    Hi so I am having difficulty making my pick up objects become prefabs. I've done the steps as instructed first making sure I make a new Prefab folder in the projects tab, then dragging my pick up object to the prefab folder. Then creating a new game object folder for my pick ups, however when moving my pick up object to the folder I am not seeing the prefab properties under the inspector right underneath tag as it appears in the video?
     
  2. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    You could try the scripting forum. You can also try IRC and ask there live. You can find the details on the "Community" page in the header.
     
  3. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    "NullReferenceException: Object reference not set to an instance of an object." means that you've not propery made a reference to your Rigidbody. Could you have forgotton to add the component to the cylinder?
     
  4. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Are you saying that the pickups are collected correctly in the editor but not on deployment? If so, what version of Unity are you using and what is your deployment target.

    If you can't collect the pickup objects in the editor, then, check things like your collider, trigger code, gameobject tag... and make sure your chain of logic is correct.
     
  5. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    This means you already have a class called PlayerController, so perhaps you tried creating a second one??
     
  6. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664

    This looks like the old standard assets script, not the Learn Project found here:
    http://unity3d.com/learn/tutorials/projects/roll-a-ball

    For more information on the Standard Asset script, can you post in the Scripting forum. You can grab my attention with @adambuckner and I'll come look.
     
  7. Adam-Buckner

    Adam-Buckner

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

    You are getting a little ahead of yourself with this project. We cover this extensively in the "next" project:
    http://unity3d.com/learn/tutorials/projects/space-shooter

    Our usual suggestion at this stage of learning is to created a prefab game object with the particles and any sounds you want and a script that destroys the game object after a set period of time.
     
  8. L0stinExile

    L0stinExile

    Joined:
    Jul 6, 2015
    Posts:
    2
    I just started using Unity today, and decided it'd be best to start with the game making tutorials.
    I'm currently on the third step of this project and I've had no issues up until now. This error keeps popping up every time I try to test the game.
    ArgumentException: Input Axis Hotizontal is not setup.
    To change the input settings use: Edit -> Project Settings -> Input
    Player_Controller.FixedUpdate () (at Roll a Ball/Assets/Scripts/Player_Controller.cs:17)
    I'm unsure what it means, I've checked the input settings several times and everything that seems necessary is filled out. Also, I have set the speed value.
    Here's the code I've got in case it helps.
    Code (csharp):
    1.  
    2. [code=CSharp]using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class Player_Controller : 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 ("Hotizontal");
    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.  
     
  9. L0stinExile

    L0stinExile

    Joined:
    Jul 6, 2015
    Posts:
    2
    Edit: I don't know what happened, but I managed to fix it by changing one thing and then putting it back to what it was before.
     
  10. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    This is just a simple typo: "Hotizontal"...

    This needs to be "Horizontal".

    (There is a t instead of an r!)

    If you look at the Input Manager, you will see Horizontal and Vertical are default axes.
     
  11. lowgan123

    lowgan123

    Joined:
    Jul 5, 2015
    Posts:
    1
    I'm having trouble with part eight player controller script. I have everything the same, yet it keeps not working.
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using System.Collections;
    4.  
    5. public class PlayerController : MonoBehaviour {
    6.    
    7.     public float speed;
    8.     public Text countText;
    9.    
    10.     private Rigidbody rb;
    11.     private int count;
    12.  
    13.     void Start ()
    14.     {
    15.         rb = GetComponent<Rigidbody>();
    16.         count = 0;
    17.         SetCountText ();
    18.     }
    19.    
    20.     void FixedUpdate ()
    21.     {
    22.         float moveHorizontal = Input.GetAxis ("Horizontal");
    23.         float moveVertical = Input.GetAxis ("Vertical");
    24.        
    25.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    26.        
    27.         rb.AddForce (movement * speed);
    28.     }
    29.    
    30.     void OnTriggerEnter(Collider other)
    31.     {
    32.         if (other.gameObject.CompareTag ("Pickup"))
    33.         {
    34.             other.gameObject.SetActive (false);
    35.             count = count + 1;
    36.             SetCountText ();
    37.         }
    38.     }
    39.     void SetCountText ()
    40.     {
    41.         countText.text = "Count: " = count.ToString ();
    42.     }
    43.  
    44. }
     
  12. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    If the script is correct ( and I will trust you that it is - I didn't see anything obvious, but didn't look carefully ) then it must be one of the other steps in the system.

    • Did you save your script?
    • Are there any compiler errors?

    We can have good code compiled into good script and still have bad project.

    Check your components...
    • Did you drag the script onto your GameObject as a Component?
    • Did you set the appropriate values in your Components?
      • Is speed set on this script?
      • Is the Rigidbody set correctly?
        • No "Is Kinematic"?
        • No locked axes?
    Double check all non-scripting steps in the video.
     
  13. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Ah - yes, this line:
    Code (csharp):
    1. countText.text = "Count: " = count.ToString();
    There is a typo. You have two = signs.

    This line should be:
    Code (csharp):
    1. countText.text = "Count: " + count.ToString();
     
  14. krimzero1

    krimzero1

    Joined:
    Jun 26, 2015
    Posts:
    2
    Yes it works correctly in editor but not in deployment. Its Unity 5.1.1f1 64 bit. Its Win, Mac and standalone. Thank you for your time and help.
     
  15. penguin3d

    penguin3d

    Joined:
    Jul 12, 2015
    Posts:
    4
    I am seeing the same issue. It works perfectly in the IDE, but in the standalone build the ball just rolls through the pick ups with no reaction.
     
  16. penguin3d

    penguin3d

    Joined:
    Jul 12, 2015
    Posts:
    4
    Here are snaps to show what I am seeing. Not sure how to debug this in the standalone player . . . This is building to a Mac running Yosemite
     

    Attached Files:

  17. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Can you submit a bug report and make sure I get the number? This way it's listed officially, and I'll be able to see your project.
     
  18. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Can you submit a bug report as well, and ,are sure I get the number?
     
  19. Apollo411

    Apollo411

    Joined:
    Jul 13, 2015
    Posts:
    1
    i have no player slot in my cameracontroller component, and i have an error that says "assets/scripts/cameracontroller.cs(22,1): error CS8025: parsing error
     
  20. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    This is because there is an error in the script. The slot cannot be created until the script compiles. You will need to find the error and try to fix it. At this point a "parsing error" is large and generic error, which means the compiler has reached a point where the script doesn't make sense and it can't understand what the issue is.

    Do you have any other errors?

    Double check the code against the steps in the video, or against the sample code on the lesson page.

    If you still can't find the issue, can you post your code? (Please use code tags: http://forum.unity3d.com/threads/using-code-tags-properly.143875)
     
  21. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    This seems to be an issue where the tags have somehow been removed from the prefabs. Oddly, the editor remembers the tags, even tho' they are undefined, but when the project is built, the new project does not see or use the tags.

    Recreate the tag "Pick Up" and reassign it to your Pick Ups and that should fix the problem.
     
  22. penguin3d

    penguin3d

    Joined:
    Jul 12, 2015
    Posts:
    4
    This got me past the issue.
    Thanks,
    Fred
     
  23. clayt8

    clayt8

    Joined:
    Jul 14, 2015
    Posts:
    2
    im having a issue with my script, basicly unity is saying i have two unexpected }'s. but what i dont understand is if i remove them it just adds more problems D:
    Assets/RollPhysics.cs(18,9): error CS1525: Unexpected symbol `}'
    Assets/RollPhysics.cs(35,41): error CS1525: Unexpected symbol `}'





    upload_2015-7-14_14-14-25.png
     
    Last edited: Jul 14, 2015
  24. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    The unexpected symbol "}" is due to the fact that the previous line is missing its ; and as the compiler is expecting a ; not a } the } becomes an unexpected symbol and compiler throws an error.

    Fix your code by ending your statements with a ;

    (^_^)!
     
  25. clayt8

    clayt8

    Joined:
    Jul 14, 2015
    Posts:
    2
    omg you ledge ^.^
     
  26. anona

    anona

    Joined:
    Jul 16, 2015
    Posts:
    1
    Hi
    Following the "Roll a ball" tutorial, and finished the "Setting up the Game" unit.
    After restarting Unity, and re-opening the "Roll a ball" project", the ball and the background disappeared.
    What might be the problem ?
    Thanks
     
    Last edited: Jul 16, 2015
  27. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Did you fail to save your scene?

    Like most pieces of software, the progess of your changes and additions need to be saved. These are saved in the scene file. If you have forgotton to save your scene, your changes and additions will be lost when you quit and restart.
     
  28. WeHeartGames

    WeHeartGames

    Joined:
    Jul 30, 2014
    Posts:
    8
    Thanks for the tutorial!
    I'm trying to get a second player into the scene, controlled with WASD. How can I specify these controls, and have them control a second marble?

    Thanks,
    -Mike
     
  29. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    You need to modify your input manager (this is available in the docs for more details)

    I would create axes for player 1 and player 2 with something like Horizontal1 and Horizontal2 and Vertical1 and Vertical2. Have one use keys ASDW and the other Up, Down, Left, Right.

    You can then have a player number as a public int variable PlayerNumber (get 1 or 2) and then you can have the same script on each ball, but instead of Input.GetAxis ("Horizontal")... and Input.GetAxis ("Vertical")... you could have Input.GetAxis ("Horizontal" + PlayerNumber)... This will return "Horizontal1" for Player 1 and "Horizontal2" for Player 2.
     
  30. MilesPerHour

    MilesPerHour

    Joined:
    Jul 20, 2015
    Posts:
    1
    Im having trouble trying to move the ball. Do i have to set up my controls in settings? i tried WASD and the arrows but neither of them was working.
     
  31. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    If spelled correctly, the Input Axes will work automagically using the WASD keys and the arrow keys.

    Did you spell "Horizontal" and "Vertical" correctly? Have you reached the point where you are assigning "speed"? And make sure that this value is larger than 0? Do you have an errors in your console? Is the game playing?
     
  32. jeanlos3

    jeanlos3

    Joined:
    Jul 24, 2015
    Posts:
    2
    Hello,
    I'd like to do something different in the condition "if count> = 12 " wondering what could have innumerable objects and was trying to create a condition where I check if all objects " Pickup " visible station however I 'm not getting and would like to help.
    Thanks and follows the code .

    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI;

    public class PlayerController : MonoBehaviour {
    public float Speed;
    private Rigidbody rb;
    private int count;
    public Text counText;
    public Text WinText;
    public GameObject Pick;
    void Start()
    {
    rb = GetComponent<Rigidbody>();
    count = 0;
    SetCountTex ();
    WinText.gameObject.SetActive (false);
    }
    void FixedUpdate()
    {
    float movHorizontal = Input.GetAxis ("Horizontal");
    float movVertical = Input.GetAxis ("Vertical");
    Vector3 moviment = new Vector3 (movHorizontal, 0.0f, movVertical);
    rb.AddForce (moviment*Speed);
    }
    void OnTriggerEnter(Collider other) {
    if(other.gameObject.CompareTag ("PickUp")){
    other.gameObject.SetActive (false);
    count++;
    SetCountTex ();
    }
    if (Pick.SetActive (false)){
    WinText.gameObject.SetActive (true);
    }
    }
    void SetCountTex(){
    counText.text = "Count = " + count.ToString ();
    }
    }
     
  33. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Can you please learn to use code tag properly?
    http://forum.unity3d.com/threads/using-code-tags-properly.143875/
     
  34. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I'm not sure I understand your question.

    Can you try asking again in a different manner?

    If you are asking several questions, can you make sure they are separated in a way I can clearly see them?
     
  35. jeanlos3

    jeanlos3

    Joined:
    Jul 24, 2015
    Posts:
    2
    then ... instead of using the condition "count if> = 12 " to the message " you win" I'd like him to do a check in the scene where he no longer exist no object " Pickup " visible to then appear " You Win " message.
     
  36. Skillfork

    Skillfork

    Joined:
    Jul 25, 2015
    Posts:
    1
    Hi, I'm having problems with my roll-a-ball project. I've triple checked the code, and it looks right, and I have speed on, at 10, but when I go to test it, the ball won't move!
    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.  
    Any idea what I'm doing wrong?
     
  37. Adam-Buckner

    Adam-Buckner

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

    Unity is CaSeSeNsItVe!

    You need to be careful and match case as well as spelling. Things like start() need to be Start() and fixedUpdate() need to be FixedUpdate(). Check all of your scripts and the entire script to match both.
     
  38. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    To do this, it's best to get a count at the beginning of the game, say "FindGameObjectsWithTag" and use the tag's name as the argument. Then you could count up to the number found. If you are afraid there may be additional objects created that are not logged, you can always rerun this when "count" >= foundObjects. You can also add to the total number of objects to pick up every time you create A new pick up object.
     
  39. GreenGalaxyOnly

    GreenGalaxyOnly

    Joined:
    Jul 26, 2015
    Posts:
    4
    Screenshot (4).png Hi , I just added a Script component to my Ball player and put the script in the Scripts folder. I was on the lesson : 3. Moving the Player. I don't know why it shows that...
    I don't speak very well in English but please help me.
    I hope the screenshot helps and that you can see the letters, I can because i can zoom in on my laptop...
     
  40. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Can you click on one of the errors and copy the full text that appears in the bottom box and paste it here for us to read?
     
  41. GreenGalaxyOnly

    GreenGalaxyOnly

    Joined:
    Jul 26, 2015
    Posts:
    4
    Does this help?

    Could not start compilationWin32Exception: ApplicationName='"C:\Yonatan's\Making games\Editor\Data\Mono\bin\mono.exe"', CommandLine='"C:\Yonatan's\Making games\Editor\Data\Mono\lib\mono\unity\smcs.exe" @temp/UnityTempFile-dce8382d357a7594686e033ff32c6133', CurrentDirectory='C:/Users/Natalochka/Desktop/New Unity Project #3/Assets/..'
    System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process)
    System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process)
    System.Diagnostics.Process.Start ()
    (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
    UnityEditor.Utils.Program.Start () (at C:/buildslave/unity/build/Editor/Mono/Utils/Program.cs:33)
    UnityEditor.Scripting.Compilers.MonoScriptCompilerBase.StartCompiler (BuildTarget target, System.String compiler, System.Collections.Generic.List`1 arguments, Boolean setMonoEnvironmentVariables) (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/MonoScriptCompilerBase.cs:31)
    UnityEditor.Scripting.Compilers.MonoScriptCompilerBase.StartCompiler (BuildTarget target, System.String compiler, System.Collections.Generic.List`1 arguments) (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/MonoScriptCompilerBase.cs:18)
    UnityEditor.Scripting.Compilers.MonoCSharpCompiler.StartCompiler () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/MonoCSharpCompiler.cs:43)
    UnityEditor.Scripting.Compilers.ScriptCompilerBase.BeginCompiling () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:47)
     
  42. Soronder

    Soronder

    Joined:
    Mar 1, 2014
    Posts:
    1
    Screenshot_project_browser.jpg Screenshot_video_project_browser.jpg
    In the video "creating collectible objects" your project browser does not only show the folders but also the assets in the left column. This is very useful to assign the material for the pickup prefab. I can't find the option to show the assets in the left column of the project browser (Unity 5.1). Am I missing something obvious?
     
  43. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Is there any chance that there is a space in the data path for your build?
     
  44. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    The upper right of the window has a button to set some details about the panel. You can try setting this to 2 column mode.
     
  45. danieldan0

    danieldan0

    Joined:
    Aug 4, 2015
    Posts:
    2
    I have deduced two mistakes "The referenced script on this Behaviour is missing!", And another in the object Player tab with the script displays the error "The associated script can not be loaded.". And in the tab with the script does not appear variable speed. And because of this the ball does not move.
    code:
    <code>
    using UnityEngine;
    using System.Collections;

    public class PlayerController: MonoBehaviour {

    public float speed;

    private Rigidbody rb;

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

    void FixedUpdate ()
    {
    float moveHorizontal = Input.GetAxis ("Horizontal");
    float moveVertical = Input.GetAxis ("Vertical");

    Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

    rb.AddForce (movement * speed);
    }
    </code>
    Help me! (Google Translate)
     
  46. danieldan0

    danieldan0

    Joined:
    Aug 4, 2015
    Posts:
    2
    Everything I decided to have this problem myself, I just have been incorrectly named class.
     
  47. Pershing01

    Pershing01

    Joined:
    Aug 4, 2015
    Posts:
    1
    So, on Unity 5 - Roll a Ball game - 2 of 8: Moving the Player - Unity Official Tutorials, my ball is not moving, and my code is the exact same as the instructor's, confirmed by a second person. I also have this error message in the console: NullReferenceException: Object reference not set to an instance of an object PlayerController.FixedUpdate () (at Assets/Scripts/PlayerController.cs:20). Any help would be greatly appreciated
     
  48. Riversr54

    Riversr54

    Joined:
    Feb 26, 2015
    Posts:
    6
    I'm working in the "Collecting the Pick Up Objects" tutorial. Everything has worked perfectly to this point. My problem now is that the Player object simply passes right through any of the Pick Ups and nothing happens. I've written the code exactly like the tutorial, even cut-n-pasted it to make sure, set the tags on the Pick Ups and set the Box Collider to "Is Trigger". I'm sure there must be something simple I'm missing but after several hours of searching, I can't seem to identify it. It seems like the Trigger Collider event is never ocurring. I've even tried to use the debugger, set a breakpoint on the onTriggerEnter code, but it never gets there.

    Any suggestions would be greatly appreciated (see code and attached images)


    using UnityEngine;
    using System.Collections;

    public class PlayerController : MonoBehaviour {

    private Rigidbody rb;
    public float speed;

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

    void FixedUpdate()
    {
    float moveHorizontal = Input.GetAxis ("Horizontal");
    float moveVertical = Input.GetAxis ("Vertical");

    Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

    rb.AddForce (movement * speed);
    }

    void OnTriggerEnter(Collider other)
    {
    if (other.gameObject.CompareTag ("Pick Up"))
    {
    other.gameObject.SetActive (false);
    }
    }


    Capture.JPG
     
    Last edited: Aug 7, 2015
  49. Riversr54

    Riversr54

    Joined:
    Feb 26, 2015
    Posts:
    6
    I fixed it but I'm not really sure how...(one of those weird programming mysteries).

    I changed the code that checks the tag to:

    if(other.gameObject.tag == "Pick Up")

    That fixed it. But then I changed it back to:
    if (other.gameObject.CompareTag("Pick Up"))

    And it still works...I can't explain that. Must have been something else in my code somehow.
     
  50. john1122

    john1122

    Joined:
    Aug 7, 2015
    Posts:
    3
    Hello,
    I new on this and I tried to make the game playable on Android so I change PlayerController.cs to this:
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using System.Collections;
    4.  
    5. public class PlayerController : MonoBehaviour
    6. {
    7.  
    8.     public float speed;
    9.     public Text countText;
    10.     public Text winText;
    11.     private Rigidbody rb;
    12.     private int count;
    13.     private RuntimePlatform platform;
    14.  
    15.     void Start ()
    16.     {
    17.         rb = GetComponent<Rigidbody> ();
    18.         count = 0;
    19.         SetCountText ();
    20.         winText.text = "";
    21.         platform = Application.platform;
    22.     }
    23.  
    24.     void FixedUpdate ()
    25.     {
    26.         float moveHorizontal=0;
    27.         float moveVertical=0;
    28.  
    29.         if (platform == RuntimePlatform.Android) {
    30.             moveHorizontal = Input.acceleration.x;
    31.             moveVertical = -Input.acceleration.z;
    32.         }
    33.         else {
    34.  
    35.             moveHorizontal = Input.GetAxis ("Horizontal");
    36.             moveVertical = Input.GetAxis ("Vertical");
    37.         }
    38.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    39.  
    40.         rb.AddForce (movement * speed);
    41.  
    42.     }
    43.  
    44.     void OnTriggerEnter (Collider other)
    45.     {
    46.  
    47.         if (other.gameObject.CompareTag ("Pick Up")) {
    48.             other.gameObject.SetActive (false);
    49.             count = count + 1;
    50.             SetCountText ();
    51.  
    52.             if (count >= 12) {
    53.                 winText.text = "You Win!";
    54.             }
    55.         }
    56.     }
    57.  
    58.     void SetCountText ()
    59.     {
    60.         countText.text = "Count: " + count.ToString ();
    61.     }
    62.  
    63. }
    64.  

    My problem is that I see some graphics issues on the Android device that I don't see on the Standalone application.

    Does anyone knows how to fix it?
    Thanks
    John