- Attach Network Identity to root of bullet to ensure it spawns on other clients.
- Create a NetworkBehaviuor script to manage any logic or data associated with the bullet.
- Add a single
int firingPlayerId;
field with the [SyncVar] attribute to the script.
- Update this variable whenever a player uses this object as a bullet to shoot (assuming you have some kind of caching going on, you'd need to change this).
Since NetworkIdentity makes sure variables are only synced when they are modified/dirtied, this won't cost you anything.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…