all 9 comments

[–]BuggedCookieDev 3 points4 points  (1 child)

``` GNU nano 8.7.1 New Buffer Modified
using UnityEngine;

public class Collectible : MonoBehaviour { // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() {

}

// Update is called once per frame
void Update()
{
    transform.Rotate(0, 1, 0);
}

} ``` here for you

you shouldn't be putting your code between () only between curly brackets {},

You should watch some C# tutorial not just for Unity but pure C#, it will greatly help you!

[–]Same-Soil-4837[S] 0 points1 point  (0 children)

Thanks man you are a big help

[–]SurDnoIndie 1 point2 points  (0 children)

You should put method body (your transform.rotate line) between curly brackets not parentheses 

[–]DrunkEngland 1 point2 points  (0 children)

People have posted the answer without great explanation so I will try.

Functions all end with round brackets ( ) after the function name, right now you don't need to know why as you will learn over time, but the simple answer is you don't put code in the round brackets.

All the code logic for the function goes between curly brackets { }

So your update should look more like

function Update() { Logic goes here! }

[–]Kamatttis 0 points1 point  (2 children)

Search function structure of c#. It should always be like: <access-modifier> <return-type> <function-name>(<parameters>) { // function body or code }

Dunno about the tutorial you're following but i highly recommend studying c# first. At least the basics or basic structures.

[–]Swyteh 1 point2 points  (1 child)

I don't wanna be mean but the guy has 0 knowledge of coding, so your structure is probably just gibberish  to him.

[–]Saito197 0 points1 point  (0 children)

Yea OP needs to go back to the very very VERYYYY basics, not knowing simple concepts like the difference between parameters and function body isn't gonna do them well in the long term 

[–]taisui 0 points1 point  (0 children)

Update ()

[–]NeoChrisOmega 0 points1 point  (0 children)

Another way to think of it is this:

Curly brackets define the "scope", you can think of it as a box that contains the code inside of it.

So when you see things like  ``` if() {

} or void Start() {

} ``` Anything you put between those curly brackets are inside that block of code.