본문 바로가기

카테고리 없음

Unity Asset Weather

I just started using Unity and read/watched a lot of tutorials. My basic (probably elementary but I couldn't find a solution after some searching) problem is that I have a bunch of models (.FBX files) and I have them imported in Unity. I could drag and drop them onto the scene and they work fine. But I am trying to write a script (which I attached to an empty gameobject to run it) that reads the names of these assets from a text file and tries to load and place them onto the scene at run time.

  1. Weather Maker Unity
Unity Asset Weather

The problem is not with reading or getting the names from the text file, they work fine.The FBX files are inside a Resources folder so that I can use Resources.Load(nameOfTheObjectAsString). After much tinkering it is complaining that there is no Renderer attached. Do I have to somehow load the FBX file as a GameObject for it to have a Renderer attached to it? Can Resources.Load return the asset as a GameObject? My understanding is that Instantiate doesn't work unless the asset is in the scene.

Best free unity assets

Weather Maker Unity

Would appreciate it if someone could tell me how to just place the FBX file on the scene at runtime from my script.Thanks very much in advance and apologies if I have broken any rules.