Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

Add component to instantiated gameboject

$
0
0
hello,

i'm using the PhotonNetwork.Instantiate in order to instantiate a game object accross the network. This work fine so far. But, when i'm trying to add a component to this, it adds only localy.
How can i make the other player see this added component?

ennemySpawn = PhotonNetwork.Instantiate(ennemyData.ennemyGO.name, new Vector3(spawnVectorX, spawnVectorY, spawnVectorZ), Quaternion.identity);

creepStats = ennemySpawn.AddComponent<CreepStats>();//attach data to the creep

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>