#Cannot create certain List types
1 messages · Page 1 of 1 (latest)
Go to Edit > Preferences > Visual Scripting and see if you can turn off AOT Safe mode see if this allows you but note if you are building for a AOT platform like mobile or web the list might not work correctly in the build if you are using one of these use AOT list instead
Thanks for the quick response. Looks like one project has the option for AOT Safe mode and it is enabled.
So then you don't have a Safe Mode option in one of the projects?
because in the project you cannot make a list of strings if safe mode is turned on in that one you should turn it off you might need to go to Edit > Project Settings > Regenerate Units to refresh the options
if that does not work can you let me know your VS version i can try and test it
Yes, the one that can make different type lists just have developer option . The project that cannot has AOT safe mode enabled.
But I will use AoT mode because I want to build for web and mobile.
It's just too tedious to set every element a specific type
if you want i could probably make a AOT List of strings type for you?
that way it will allow you to use List of string but still work in the build
That would be great
You should be able to add this to your project then just add the type in the Type Options which is in Edit > Project Settings > Type Options after that just regenerate the Units
Thanks!
You're welcome
I don't know if you know C# but if you want any other types you can, Duplicate the script change the parts in yellow to the type name like for example Int which is integer
then change the parts in red to the type name but with lower case characters(Only for basic types bool, int, float, etc) for other types just use the normal name.
Thank you!
What is the difference between this and AoT safe mode? Will this work with web and mobile but AoT safe mode disables will have some issues?
The difference is List of string they way Visual scripting handles it is not supported by AOT(Which is why there is the safe mode option) so if you turn of AOT Safe mode and use the List of string it will probably have problems but this should be supported because it telling Unity to save this info for the build the only limit is that you can only use the specific types like if you want a list of integer you need to make a new script to allow you to do so. Hope that's clear