Hey all, I am a beginner in coding. I encountered a few errors that I can't seem to fix. Line 28 and Line 33 says, "Feature 'local functions' is not available in C# 4. Please use language version 7.0 or greater." I tried fixing this by installing Microsoft.Net.Compilers as shown when I look the error up, but I still have these problems. Line 24 says I need a definition when I thought I added one? Line 25 says cannot convert object to int. I have no clue on that one.
Put your code in code tags in forum, don't send file. https://forum.unity.com/threads/using-code-tags-properly.143875/ You have big problems with brackets, here you are short tutorial: Example of correct code structure Code (CSharp): public class NameOfClass { // starts class's block void Method() // declare method { // starts Method's block foreach(var item in collection) { // starts foreach loop block // code } // ends foreach loop block } // ends Method's block void SecondMethod() // declare second method { // starts SecondMethod's block //code } // ends SecondMethod's block } // ends class's block You can't do something like this. Code (CSharp): public class NameOfClass { // starts class's block void Method() // declare method { // starts Method's block void SecondMethod() // declare method in method { // starts SecondMethod's block foreach(var item in collection) { } // inlined start and end foreach loop item.ToString() // you are outside loop } // ends SecondMethod's block } // ends Method's block } // ends class's block