- Home /
(PUN) How to set up local player's position and other player's positions at a fixed transform.position?
I'm working on a 2D game that has the local player's position always instaniated at the bottom of the screen. Then when more player's join the room (max of 4) the other player's positions should be left edge of screen, top of screen, and right edge of screen.
Can someone point me in the right direction on how to always make sure the local player is at the bottom, but on the other player's screen their position is fixed to one of those other positions (left,top,right)? All the photon pun tutorials i've come across are FPS/MMO in theory and only use the spawnpoint once and then the player can move around. In the game I'm working on the spawnpoint is where the player is instantiated and is fixed there until they disconnect/leave room. (They just stay fixed there and can shoot at enemy AI's).
Please have a look at this topic, it's about the same question.
If you have further questions, please feel free to ask them.
Thanks for the link, that looks very similar to what I'm trying to do but a little different. Would PlayerRoomIndexing allow me to set the local client's position to always be at the bottom of the screen , but on other player's screen it would be at the top?
For example if me and you are in a room , your gameobject on your screen will be on the bottom of your screen (next to the controller UI's), and my gameobject on my screen will be at the bottom of my screen but on my screen your gameobject is across from me at the top of the screen and on your screen I'm at the top of the screen.
Should I stay away from using photon.instantiate so I can accomplish? As it seems to instaniate a prefab in the room for all to see. What I was thinking of doing was just instantiatiating a local gameobject for the client and then for each other players who come into the room I locally instantiate their gameobjects as well at one of the fixed spawnpoints and get data from their client as to where they're ai$$anonymous$$g at and rotate the gameobject towards that... I'm new to Photon so I'm still trying to wrap my head around how everything fits in place sorry if I didn't word it right
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Network.Instantiate issues - GameObject ownership and network views? 0 Answers
Changing Server/Network type. 1 Answer
MMO Server backend: Smartfox or Photon 2 Answers