Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

Sorting the player's game objects above the other player's game objects

$
0
0
Hi,

For my '2 players' 2D game, both players' game objects are spawned on the same spawn points.
But the remote player's game objects are on top of the local player's game objects.
So to get the local player's game objects on top I put this in the game objects' script:
void Start()
{
if (!photonView.isMine)
{
this.gameObject.transform.position = new Vector3(transform.position.x, transform.position.y, 1);
return;
}
I also tried changing the spriterenderer's sortinglayer and sortingorder but the remote player's game objects stay in front the local player's game objects.
What seems to be the issue?

Best regards
Nikola

Viewing all articles
Browse latest Browse all 15755

Trending Articles