So i have a GameObject thats pretty much just a box primitive made inside of unity, but at the objects creation I want to assign a random texture to out of like 40 textures. Making the randomness happen i know how to do but i cant seem to get it to assign a actual texture. this is what im currently trying inside of a script component attached to the game object. I am using C#.
Check the Resources.Load documentation. You shouldn’t use file extensions (you’re not loading the same file you put in the assets folder, but its imported equivalent). Also make sure that whatever you’re loading is in the Resources folder.
Ah I think you have given me the clue I need Jasper, I just had my textures in a folder in my project not in any special Resources folder or section. I am not at home at the moment but when i get there ill definitely see if i can figure the Resources folder thing out.
You could also create a script that stores all of your textures and then reference that script in your script that loads it. That way you don’t have to do any loading during the game, it’s all front loaded.