- Home /
into which folder can i import my jpeg files so i can put some texture on a wall obj?
Into which folder (where) can i import my jpeg files so i can put some texture on a wall object?
i have an oBuilding object and i want to put a texture on it. Example:
oBuilding.renderer.material.mainTexture = Resources.Load("wall_");
The thing is i can't see anything on my building's wall, although i copy/paste the wall_.jpg file to my Resources folder (C:\Program Files\Unity\Editor\Data\Resources).
I suppose there is something wrong with the path, when we refer to Resources folder we mean the path i wrote in the brackets?
Any advice would be appreciated much, thank you all.
The Resources folder should be in the project itself : => [YOUR PROJECT] => Assets => Resources
Why don't you just use a texture asset, and attach it using the inspector? You don't have to load things using string literal filenames in Unity, you know.
It's as simple as dragging your material to project view, then dragging it onto the object you want textured. No need to script anything
Thank you all people. I got the idea thnx to you.
alucardj --> worked like a charm! thnx
commodore --> i had to do it via script. $$anonymous$$y fault, i did not mention it.
I also found some examples with the Color structure. for example: oBuilding.renderer.material.color = Color(0.2, 0.3, 0.4);
that works for me too, for what i have in $$anonymous$$d.
Cheers people.