0

I've been learning C# and Unity, but one problem I have is when writing the C# script on Visual Studio, VS seem to always recommend scripts not useful for Unity.

An example is when I type in Vector3, it'll recommend BitVector32. You can't ignore them as if I just continue typing, it'll force these suggestion all the time, I end up with mistakes all over my script

Anyone know how to fix this, or how can I make sure that VS recommends useful code for Unity instead?

Warty
  • 7,237
  • 1
  • 31
  • 49
strkiky2
  • 79
  • 6
  • Does VS recognize Unity, i.e. is Vector3 even an option when you type it out? If not it's probably because VS doesn't recognize it(?). If it is an option it's probably a VS issue. – Apoqlite May 17 '20 at 03:26
  • When I check the VS installer, unity is included in the tick boxes. But no, Vector3 is not an option when typed out. – strkiky2 May 17 '20 at 03:38
  • Yeah, I'm sorry, that's just the first thing that came to my mind. This sort of thing happens in Eclipse too, for e.g. `String.equals()` autocorrects to `String.contentEquals()`. But from your example, it seems like there might be another problem. – Apoqlite May 17 '20 at 03:42

2 Answers2

1

In unity, make sure the default editor for script files is VS and not just your default program which is most likely VS anyway. You can find this option under edit > preferences > external tools from memory, not at my pc to double check.

For some reason unity doesn't fully bind to VS unless this option is set.

Zami
  • 113
  • 5
0

You can press ctrl + alt + spacebar to turn off auto complete and it will just suggest or go to settings -> intellisense -> toggle completion mode.

https://learn.microsoft.com/en-ca/archive/blogs/zainnab/intellisense-suggestion-mode

Im not sure why it is suggesting Bitvector32 , did you import

using System.Collections.Specialized;

somewhere in your code? You may have this and other imports in your namespace you do not actually need which are prompting unneeded suggestions

vasmos
  • 2,472
  • 1
  • 10
  • 21