I started making simple code, with variables and all of those things, but now i get an error 1012, its extrange because i investigated, and i can't find any tipe of failure. This is my code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class Selection_seed : MonoBehaviour { // Start is called before the first frame update void Start() {} public bool Selected; public int Plant; public int position; public bool OcupedA; public bool OcupedB; public bool OcupedC; public bool OcupedD; public bool OcupedE; public bool OcupedF; } // Update is called once per frame void Update() { if (position = 0) { GetComponent(MeshRenderer).enabled = false; } else if(position = 1) { gameObject.Transform.position = new Vector3(-41.8f, 16.2f, 0.1f); } else if (position = 2) { gameObject.Transform.position = new Vector3(-41.8f, 9.2f, 0.1f); } else if (position = 3) { gameObject.Transform.position = new Vector3(-41.8f, 2.2f, 0.1f); } else if (position = 4) { gameObject.Transform.position = new Vector3(-41.8f, -5.2f, 0.1f); } else if (position = 5) { gameObject.Transform.position = new Vector3(-41.8f, -12.2f, 0.1f); } else if (position = 6) { gameObject.Transform.position = new Vector3(-41.8f, -19.2f, 0.1f); } } }
Your Update is not in your MonoBehaviour class. Code (CSharp): public bool OcupedF; }//class is closed here Your Start is empty but likely should be because why would you declare variables in Start and not even use them before they are removed from memory; but might be why you are confused with your brackets. Code (CSharp): void Start() {} Also please use code tags when putting code in the forum. Toolbar->Insert->Code