I am making a small multiplayer game in which a visitor and an uploader will join at the same time.
The uploader will upload an image to their scene(javascript - Unity3D - Upload a image from PC memory to WebGL app - Stack Overflow)
I want this image to be visible on an image in the main game which the visitor is playing.
This game will be running on a headless server and all the networking is done using Mirror.
I don’t have any clues as to how to code or implement this. Any help is appreciated.
You should be able to send the texture sprite as an array of bytes to the server via RPC. You can google for how to convert a texture to byte array, and a byte array into a texture. This is referred to as Serialization, you can serialize it to bytes to send to the server via RPC or to store somewhere on disk.
Once you have a reference to the texture in memory all you need to do is assign it to a variable that’s either on a static class or a monobehavior class attached to an object where you called Don’t Destroy On Load so that when you switch scenes it stays around. If you don’t already have Manager/Controller type classes or Singleton pattern classes then you should look into them as well as ScriptableObjects.
If you’re looking to upload a picture that doesn’t already exist in the game, you’re gonna need to set up a web server to make that possible. You could check out upload.io, which has a simple API to upload and then visualize images. Once you have that, you need to find out a way to check when the image has successfully been uploaded so it can be displayed on the other player’s screen.
Is there any other approach of doing this ??