I have some (hopefully simple) questions. I’m trying to make a simple single player game and it would be perfect for an additionel multiplayer, but (ps. im using Mirror) can I just use the same scripts with “Monobehaviour” instead of “Networkbehaviour”? Or do I have to duplicate all?
I would just use NetworkBehaviour for anything that needs to be networked. Mirror should work like a singleplayer game if you code it like a multiplayer game by hosting your own server and connecting to it as a client (listen server). You’re just sending packets to yourself at that point. Duplicating the code would seem like a massive hassle, especially if you’re trying to fix bugs.
E_zinc is correct but if you’re also just getting started maybe check out Fish-Networking. It offers a lot more features, it’s also free, and I’ve been told many times by people coming from Mirror that Fish-Networking is easier to use.
Also, Fish-Networking has a true offline mode that won’t open any ports but it still runs off your multiplayer code. This lets you write code once for offline or online use.
All links can be found on the documentation
I am, thank you! Most of those are built into FishNet for free as well, others are available to patrons and everyone gets grandfathered so there’s no price increase for people leaving Mirror.
The easiest solution, as already mentioned, is to use Fish Networking (or PUN Fusion) and make use of their offline mode which allows you to use the same code for both single player and networked modes.