Getting Error - Feature "Local functions" is not available in C# 4

Hi Folks,
Scratching my head how to get past this block. I am using Visual Studio 2017 and getting the below message. I have looked in the StackOverflow forum and even tried to find in the Unity documentation but without any success. I can’t run the game until I fix the problem. Any help is highly appreciated.

Hello @Nurul_Chowdhury,

This issue is caused by you having a method within another method.

You will note from your screenshot void SpawnBullets() is within another method, unfortunately, I cannot tell you which as you haven’t included all of your code in the screenshot, but you basically want to move the code from lines 45-54 (inclusive) to line 57 (assuming your indentations are good).

Please note that you can just paste your code into your posts on the forum.

See also;

1 Like

Hi @Rob Thanks for the solution, got it resolved now, I had type it inside the update method.

1 Like

You are very welcome Nurul, glad you can move forward again :slight_smile:

1 Like

Privacy & Terms