Home > OS >  How to instantiate a prefab and set its dependencies with PHOTON
How to instantiate a prefab and set its dependencies with PHOTON

Time:10-07

Im trying to isntantiate a prefab with photon bit i have this issue enter image description here

Thats because the prefab im trying to instantiate needs some dependencies from de scene like the camera enter image description here enter image description here

Any ideas how can i do this?? :/

Thanks a lot!

CodePudding user response:

Just try to assign the object in the script. If you need the camera use

followObject = GameObject.FindWithTag("MainCamera");

or

followObject = Camera.main;

in the Start() method.

  • Related