Open StupidRepo opened 3 days ago
You have to do it the same way as you would when making the game itself, have all people run the same code and resources so that the environments are all the same.
What do you mean by that? Because what I'm saying is that the prefab itself needs to be physically in a folder in the Unity project, but as a simple modder with no access to the project then how can I add a prefab and register it to allow Photon not to complain?
Or am I being really stupid here? ðŸ˜
Just put it in an asset bundle and load it that way.
But I thought PUN would only load things if it was in that special folder?
You can load ABs from wherever you want https://docs.unity3d.com/560/Documentation/ScriptReference/AssetBundle.LoadFromFile.html
Yeah I know that but I'm pretty sure PUN has a weird restriction on networked prefabs from ABs. Maybe I'm wrong...
@ManlyMarco If you take a look, you can see (to instantiate a networked object), I would need to pass through a prefab name. Oh and, also:
I guess I could make my own RPC instantiation, but why reinvent the wheel?
Sorry if this issue doesn't fit here, I'm not really sure where to put it as it is kind of a BepInEx question and also a Photon Unity Networking (PUN) question.
Effectively, I'm trying to make an API for a multiplayer game where I can add items to the game and sync them across the network however (iirc) a prefab will need to be put in a specific folder for PUN (
Resources
, iirc?).So, is it possible to make my own prefab instantiable by my plugin using PUN to sync it to others with the mod? I know I'll need an AssetBundle to hold the prefab but then I'm not really sure where to go from there. Other games I know with BepInEx custom item plugins don't use PUN (e.g. Lethal Company) so I wouldn't know any open source plugins I can 'borrow' code from...