Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

How would I do this in PUN?

$
0
0
I have a mobile game where the local player is always on the bottom of the screen next to the game controls, but I'm trying to figure out how to make them show up on one of three spawn points (left, top, or right) on everyone else's screen when they're not the local player, the gameobject they control is a turret and the only thing that needs to be sent is the rotation since their position will be different and will always be on the bottom on their own screens.

I've tried using PhotonNetwork.Instaniate and then setting up PhotonView on the gameobject but when I instantiate them on their main position (bottom), it instantiates all the players on the bottom.

Since that didn't work I tried instead to instaniate the gameobject locally on Unity and then for each player that's in the room it would instantiate another gameobject locally starting on the left spawnPoint and going clockwise, but the problem with doing this is that the photonview owner is set to "scene" and I can't get the cannon's rotation. Am I going about this the wrong way? I'm new to PUN and still trying to wrap my head around how everything fits together.

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>