Spawning AI characters over the network

Dreadnought9999

New member
So, I'm working on a multiplayer first person shooter project, and I'm working on getting my AI characters to sync properly over the network. In order for that to work properly, I suspect that I need to have all the AI characters spawned at start up, so I have been trying a couple of things so far.

1. Trying to spawn the AI character using the Single Character Spawn Manager. Has either done nothing or interrupted the player spawning.
2. Trying to spawn the AI using the PunObjectPool class, which spawns the AI, but throws all of these Illegal id errors, which I believe has to do with the fact it shares a lot of the same components as my player character, but those probably are not getting set up properly when I use PunObjectPool.Instantiate.

So I want to ask what else I would need to set up if I were to spawn the character using PunObjectPool.Instantiate.

Or, if there are any components that the AI character does not need in order to function that the player might. For context, the AI needs to have health, inventory, and be able to path find

list of components is as follows:

Transform
Animator
Character Layer Manager
Rigidbody
Soldier AI (my AI controller)
Player Data (my custom class for checking teams)
Ultimate Character Locomotion
Inventory
Item Set Manager
Attribute Manager
Character Health
Character Respawner
Character IK
Character Foot Effects
Nav Mesh Agent
Remote Player Perspective Monitor
Local Look Source
Photon View
Pun Character Transform Monitor
Pun Character
Pun Network Info
Pun Attribute Monitor
Pun Health Monitor
Pun Respawner Monitor
Combat Listener (My custom script for tracking which characters are dealing/receiving damage for UI)
Pun Look Source

Any help is greatly appreciated.

Thanks in advance
 
You should use PunObjectPool.Instantiate - the SpawnManager is for player controlled characters. Beyond that you should create an AI character using the Character Builder which it looks like you already have. I would focus on fixing the errors that you receive from doing option 2.
 
Yeah, using PunObjectPool.Instantiate, seemed to be the correct solution, the Illegal ID errors I was getting was because I needed to assign a view ID to the new characters with PhotonNetwork.AllocateViewID().

Thanks for your help
 
Top