NetworkCode , want to spawn 2 diffrent prefabs for 2 players

Hello , i am making a game with 2 players only , i used Playfab to do the login and matchmaking , one player will be defender and he will use AR camera to defend agienst ghosts , while the other is attacker and he have a topdown camera with a menu to spawn ghosts, how i can make it that after matchmaking each player is assaigned a role and each one have a unique prefab.

thanks for any help i get , i always have trouble when it comes to network

Unique prefabs: make your network player object an empty shell. It contains just the NetworkObject, NetworkTransform, and any other script that you need.

Then instantiate whatever you need (eg a prefab of an avatar mesh with animator) as a child of this object BUT none of these children should be networked at all. The child scripts communicate with the parent object’s scripts, effectively you will relay any network actions through the main player object’s scripts.