Home > Mobile >  C# visual studio for unity not showing start() function when typed
C# visual studio for unity not showing start() function when typed

Time:06-14

I have just started programming but I can't follow this tutorial. In the tutorial, it shows that when they write start the start function apears.

image1

When I type it in this happens

image2

CodePudding user response:

you need to make sure that your script inherits the MonoBehaviour class. There are dozens of methods in MonoBehaviour such as Start(), Awake(), Update(), FixedUpdate(), OnGUI(), no matter which one you use. MonoBehaviour must be inherited. If the visual studio is not installed when you install unity, you need to install additional tools.

You can try as follows:

  1. edit->preference->external tools.

enter image description here

  1. Change the default to visual studio.

enter image description here

  1. After setting, the c# script will be opened as a unity project when it is opened through vs.Hope it helps you.
  • Related