Search Unity

Beginner Troubles

Discussion in 'Scripting' started by adesena103, Jun 21, 2018.

  1. adesena103

    adesena103

    Joined:
    Jun 21, 2018
    Posts:
    2
    Hello,

    I've just VERY recently (last night) started messing around with Unity and I know almost nothing about it. Especially the coding. I have followed a tutorial to get some simple movement for something in Unity, but is says that there is an error at the very end. I haven't found a solution yet. Any help/tips would be appreciated :)

    I have included a snip of what it looks like; code not workkk.PNG

    Thanks
     
  2. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,539
    For every open curly, you'll need to inevitably have a closing curly. This open and close defines a 'scope'.

    You open for the class
    You open Start
    You close Start
    You open FixedUpdate
    You close FixedUpdate
    ...

    You're missing a close for the class.

    Stick '}' at the end of your code file. Down there at like line 23 or 24 or something.

    Note, if you go to 'View->Error List' and keep that window open. You'll see all compiler errors in your code. Also if you mouse over that red squiggle it'll describe that specific error. The error will often hint at what the problem is.
     
    JoeStrout and xVergilx like this.
  3. adesena103

    adesena103

    Joined:
    Jun 21, 2018
    Posts:
    2
    Alright that worked! thank you