I have my game level and some character prefabs.
In my game level class I have:
public GameObject mainChar;
normaly I would just drag and drop the character prefab over that variable, but the problem is that I’m loading assetsBundle externally.
How to set the character inside that variable via code?
thx
You would use the start function for that.
public GameObject mainChar;
void Start(){
mainChar = GameObject.Find(“ObjectName”);
}
That would search through the object already instatiated.
I need to take a particular asset.
Maybe I should use Resources.load, but I don’t know if it is possible in combination with asseboundle loading?
Please anyone did try it?