- In my UnityScript code I need load a prefab. Currently, I’m doing this as
var prefab : GameObject = Resource.Load("MyPrefab")
which gives me a warning about implicit conversions from Object
to GameObject
. I need it to be a GameObject
because I need to position it based on its renderer.bounds.size
. How can I get rid of this warning?
- When instantiating with
Object.Instantiate
, is it safe for me to convert the returnedObject
toGameObject
? I need to modify some of its attributes when placing it in the world.