Search Unity

Resolved Somebody Please Help!!!

Discussion in 'Scripting' started by Henry_mullin, Jan 3, 2021.

Thread Status:
Not open for further replies.
  1. Henry_mullin

    Henry_mullin

    Joined:
    Jan 3, 2021
    Posts:
    13
    I recently downloaded unity on my mac mini and i'm using version 2020.2.1f1 and when i try scripting following a tutorial it doesn't open up visual studio. it open us a different thing called text edit and i want to set visual studio to my default.

    and when i code even if i follow the tutorial exactly it doesn't work the way its supposed to and it doesnt even run. what should i do?
     
  2. VolodymyrBS

    VolodymyrBS

    Joined:
    May 15, 2019
    Posts:
    150
    First of all "Somebody Please Help" is pretty bad title for thread.

    If I remember correctly Text Editor it's default macOS default app for opening text files.
    Visual Studio available only on Windows.
    You could try other code editor on macOS. For example Visual Studio for Mac (sounds similar but it's different product), Rider (not free) or Visual Studio Code.
    You could select code editor that Unity will use in Preferences on External Tools tab https://docs.unity3d.com/Manual/Preferences.html#External-Tools

    to answer this we need to know what exactly doesn't work at least.
     
    John_MSFT likes this.
  3. John_MSFT

    John_MSFT

    Microsoft Employee

    Joined:
    Feb 21, 2018
    Posts:
    118
    Joe-Censored likes this.
  4. hdmullin1057

    hdmullin1057

    Joined:
    Jan 5, 2021
    Posts:
    4
     
  5. jbnlwilliams1

    jbnlwilliams1

    Joined:
    May 21, 2019
    Posts:
    267
    Post the error your are seeing!
     
  6. Ray_Sovranti

    Ray_Sovranti

    Joined:
    Oct 28, 2020
    Posts:
    172
    Copy and paste the exact code you're using using [code ]code tags[/code], a link to the tutorial you're following, and the entire error message you're getting.

    With what you've told us so far, it could be almost anything. There are a number of seemingly insignificant syntax mistakes that are very hard to see, but cause compilation to break. It's possible that you genuinely have done everything precisely according to the tutorial, but if you're following a very old tutorial it might be using an obsolete function that has been removed. It's possible that your error might be caused by some other setting or something. Without seeing the above information, we just can't know and can't help.
     
    VolodymyrBS likes this.
  7. Henry_mullin

    Henry_mullin

    Joined:
    Jan 3, 2021
    Posts:
    13
    youtube link ->

    code I used:
    using system.collections;
    using system.collections.generic;
    using UnityEngine;

    public class ThirdPersonMovement : MonoBehavior
    {
    public CharacterController controller;

    public float speed = 6f;

    void update ()
    {
    float horizontal = input.GetAxisRaw("horizontal");
    float vertical = input.GetAxisRaw("vertical");
    vector3 direction = new vector3(horizontal, 0f, vertical).normalized;

    if (direction.magnitude >= 0.1f)
    {
    controller.move(direction * speed * time.deltatime);
    }
    }
    }

    error message -> all compilation errors most be fixed before entering play mode.
    and when i create a new project it says: the project you are opening contains compilation errors.


    and when my script gets entered in i should see this Screen Shot 2021-01-06 at 9.16.25 AM.png

    but instead it just compiler errors and shows nothing :(
    how should i fix this?
     
  8. VolodymyrBS

    VolodymyrBS

    Joined:
    May 15, 2019
    Posts:
    150
    use code tag in the future. it will be much easier to read code
    Code (CSharp):
    1. using System;
    2.  
    3. public class DummyClass
    4. {
    5.     public void DummyMethod
    6.     {
    7.  
    8.     }
    9. }
    C# language is case sensitive.
    I see few pleases where you use lower case instead of upper case:
    * update() should be Update()
    * input should be Input
    * time should be Time
    * vector should be Vector3
     
  9. Ray_Sovranti

    Ray_Sovranti

    Joined:
    Oct 28, 2020
    Posts:
    172
    If you click on that it will open the console and you can see what the actual errors are. (@VolodymyrBS has pointed out some of them. Your first two lines are also capitalized incorrectly)
     
  10. Henry_mullin

    Henry_mullin

    Joined:
    Jan 3, 2021
    Posts:
    13
    thanks for the help! i got it working now,
     
    John_MSFT likes this.
  11. shevkar

    shevkar

    Joined:
    Oct 16, 2023
    Posts:
    3
  12. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Please stop cross-posting/necroing.
     
Thread Status:
Not open for further replies.