System.Collections data types missing from VS?

Hello Unity Community.

I’ve recently imported Visual Scripting into my project. I’m shocked to find that I can’t make variables of List type. The only options for Lists (in the fuzzy finder, and in the variable finder) are AOT lists.

There’s screenshot proof here that shows VS supported generic lists, and indeed Bolt supported it before Unity purchased it. Am I missing some import setting or has System.Collections been removed from VS? Any clues?

Versions
Unity 2021.3.11
VS 1.7.8 (latest)

Update for future googlers.

Opening a new project and importing Visual Scripting does give me generic lists. So this problem local to my project specifically. Will investigate further.

New update. This seems to be a problem with any project being switched to Android and regenerating units. This seems to be a Unity’s VS issue

System Collections are generic, and generic collections in UVS are AOT unsafe so they’re filtered out by AOT Safe Mode based on platform/scripting backend selected. This is why AOT List that accepts any type was implemented. You’re supposed to use that instead. Or hold the generic list in a C# script and operate with that since it’s compiled at edit time and is AOT safe.

1 Like

Interesting. Looking at this doc, it seems you could disable AOT Safe Mode in a previous version of Bolt, presumably before Team Unity built it into UVS. Where as in UVS, there doesn’t seem to be an option to. Or, at least, I can’t find an option. Does that option still exist?

It should be one of the checkboxes in Projects Settings/Visual Scripting or was it Preferences/Visual Scripting. One of those.

Just note that if you want to use the generic collections in UVS variables with IL2CPP scripting backend, they won’t work in builds. AOT safe mode is there for a reason.

1 Like

I understand. After some discussion it looks as though we will be rolling our own collections units to work around this.

Thanks for your help. I will update this thread with a re-cap post for future googlers.

I have been trying to solve a problem for days. The problem is that my PC got reset and I downloaded all the game development softwares I needed like Unity Hub, Visual Studio, Blender, Aseprite, etc. But when I tried to code a player movement system I found out that the variable list is missing a lot of things like, Rigidbody, Gameobject, ParticleFX, etc. However, I still have basic data types like float, long, bool, int, etc. Any help is greatly appreciated.

Use AoTList, it accepts any type and is supported on all platforms.

thanks for your help but was able to fix it because in the setup i accidentally forgot to install the github copilot and the intellisense system thing but now it works