Implementing very flexible multiplayer (UNET) Weapon System?
Please read till the end before answering thanks.
Hello everyone, I have searched the web for a while to find out answer to my question, but didn't find it. I am making a multiplayer fps shooter in Unity using its UNET networking. My question is how to make flexible weapon system from which you can create any kind of weapons like Pistols, Rifles, Shotguns, Rocket Launchers, Bombs, Knifes, Shields e.t.c. I have read about component based architecture where you make small lego pieces when combined create unique behaviors so I thought that I can use it, but one problem! How to implement it in multiplayer when you write all the logic in the Player itself because only player object has a NetworkIdentity and the weapons are parented inside player thus cannot have its own identity said in the docs. Which means that weapons cannot do action by them selves cause they don't have NetworkIdentity. I have read the docs that only root object must have a NetworkIdentity. What I want to say with all of these is that all the input handling, raycasting, projectile shooting e.t.c all the action you have to write in the base Player object not in weapon object itself which clutters up the script. What I want is to divide everything into mini scripts like ( RaycastShoot, ProjectileShoot, FireType, MuzzleFlash, Recoil, Damage, Ammo and e.t.c) but I don't know how to do it with multiplayer. I would really appreciate if someone will help. Thanks!
Your answer
Follow this Question
Related Questions
UNET (Multiplayer) calling [command] function twice 0 Answers
Network collision delay problem 0 Answers
Photon ccu question 0 Answers
Merry Fragmas 3.0 not working on android 0 Answers
Using syncVar in networkManager 1 Answer