How to control NPC?
I don't know if there's any example project available to learn, but I have no idea of how to control NPCs. I can spawn them, but it seems that two AI bots do the same in game that is when one shoots another does the same and when one is killed the other is killed too. I have the following code:
Code (CSharp):
if (this.photonView != null && !this.photonView.isMine){
this.enabled = false;
return;
}
in all of the NPC scripts (Awake or Start funcion), but it doesn't work somehow.
Code (CSharp):
if (this.photonView != null && !this.photonView.isMine){
this.enabled = false;
return;
}
in all of the NPC scripts (Awake or Start funcion), but it doesn't work somehow.
0
Answers
-
As exmaple, every player which joined is responsible for some NPc to share the performance with it, the NPC`s getting spawn over Boltnetwork.Instantiate and the controller for the NPC run over the players, which spawned them. The sync will be equal, as for you player.
Stuff as damage will be care with events. https://doc.photonengine.com/en-us/bolt/current/getting-started/bolt-101-wizard-setup0