Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice
  2. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

error CS1002: ; expected

Discussion in 'AR/VR (XR) Discussion' started by OpheliaHed, Aug 11, 2020.

  1. OpheliaHed

    OpheliaHed

    Joined:
    Aug 4, 2020
    Posts:
    10
    I am very very new to Unity and I don't know anything at all about coding. I'm trying to build a ar thing for my class and currently following this tutorial.



    Perhaps there's something in the code I did wrong or perhaps the code is simply just old? I'm using the latest version of Unity 2020.

    Here's the code I copied from the tutorial. Thanks for the help!
    upload_2020-8-11_15-29-53.png
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    919
    Line 38: You need to add a semi-colon to the end. All statements in C# must be terminated with a semi-colon.
     
  3. OpheliaHed

    OpheliaHed

    Joined:
    Aug 4, 2020
    Posts:
    10
    thank you so much for the help!
     
  4. OBEZYOSEF

    OBEZYOSEF

    Joined:
    Mar 18, 2021
    Posts:
    1
    I can't find the except ;

    here is my code


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

    public class OtomatikMap : MonoBehaviour
    {
    public List<GameObject> mapler;
    public int KacMapGelsin;
    private float m_LastPos;
    void Start()
    {
    for (int i = 0; i < KacMapGelsin; i++)
    {
    int newid = i;
    int RandomMapver = Random.Range(0, mapler.Count);
    GameObject newMap = Instantiate(mapler[RandomMapver]);
    if (newid == 0)
    {
    Debug.log("aa");
    newMap.transform.position = new Vector3(0, 0, 0);
    }
    esle {
    newMap.transform.position = new Vector3(m_LastPos + 17.76f, 0, 0);
    Debug.log("aa");
    }
    m_LastPos = newMap.transform.position.x;
    }
    }


    }
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    11,140
unityunity