Hello, I'm kind of new into Photon, but I managed to create simple scene on which 2 clients control 2 cubes on a scene. Tutorial which I followed has some kind of mistake, so I re-written code by myself. Problem is that on 1 client there are 3 cubes, but on 2nd client there are 2 cubes. Spawning players works like this: - first Menu loads Game scene with PhotonLoadLevel(game). -then there is SPAWNER object on Game scene which in void start does: PhotonInstantiate(player); Commands I wrote are just approximate, I don't remember exact functions. On original tutorial there was some RefreshInstance function but it didn't work.
This is a duplicate of this post https://forum.unity.com/threads/photon-unity-networking.101734/page-44#post-4269292 Worded slightly differently but essentially the same question.
Yeah, at first I wrote this post and after I've gone deep into forum and posted it on Photon post. I'm sorry
Hey, yeah I did after watching some tutorials on YouTube for PUN1 and I understood how everything works. I just hate working with documentation but it seems like I will have to get used to it.
Could you just explain if this is the method is right?(it works) In menu I have Manager which is not destroyed over scenes. Upon pressing button it connects to random room or creates one if there are none available and then: 1. Photon load level. 2. OnJoinedRoom() PhotonInstantiate(Player); And in player movement script: If (!PhotonViewIsMine) return; (ignore code if you are not player creator)
> connects to random room or creates one if there are none available This is similar to what ConnectAndJoinRandom.cs does. Fine for a start. The workflow sounds good, yes.
Could you help me with 1 more thing? As I understand Photon, when for example player A shoots bullet in straight line he is the "owner" and he sends bullet's position to other players several times a second. Bullets most often fly I straight lines, so can't player A only send information - startPos,startRot and it will be created locally on other players game? In my scene there can easily be like 50 bullets on scene. Won't that be too much for Photon to send every position and rotation?
You are right: Sending updates for each bullet would be overkill and mostly useless info for short-lived bullets. We don't have a sample for it but what you suggest works: Send when and where someone shoots in which direction and everyone can move the bullet with some precision (not perfect but fine for visuals) without new input.