Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by frencrus78 · Sep 23, 2021 at 03:36 PM · photonclient-servermaster

Unity Photon 2 only master client can see others players

Hi, I'm trying to create a multiplayer game with photon 2. When players enter the room, only the master client can see the other players, the others can't. Below is an example screenshot. How can I fix this?**

alt text

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using Photon.Pun;
 
 public class SpawnPlayers : MonoBehaviourPunCallbacks
 {
 
     public Vector3 spawnPlayers;
 
 
     // Start is called before the first frame update
     protected private void Start()
     {
         spawnPlayers = GameObject.FindGameObjectWithTag("SpawnPalyers").transform.position;
         Spawn();
     }
 
     protected private void Spawn()
     {
         PhotonNetwork.Instantiate("Player", spawnPlayers, Quaternion.identity);
     }
 }


immagine.png (219.2 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Captain_Pineapple · Sep 23, 2021 at 04:04 PM 0
Share

unless you add relevant code to explain what you are doing noone will be able to tell..

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by miha4406jp · Sep 23, 2021 at 04:54 PM

Players use network instantiate? They have PV component? If you use existing game objects with PV component attached they will not synchronize automatically.

Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image frencrus78 · Sep 24, 2021 at 01:07 PM 0
Share

Initially the player enters the hobby and can create or join in a room. Once in a room, my player is instantiated with PhotonNetwork.Instantiate and he has a photon view component. Please hep me because i am really frustrated.

player-script.png (147.8 kB)
playerprefab.png (209.7 kB)
avatar image Captain_Pineapple frencrus78 · Sep 25, 2021 at 09:31 AM 0
Share

the most relevant code parts would be how and where you actually call the isntantiate calls. Can you add this as well?

there is also a code formatting button (the one with the numbers above the text input for your posts) which allows you to properly add code to your posts without the need to upload images.

avatar image frencrus78 Captain_Pineapple · Sep 25, 2021 at 04:39 PM 0
Share

Done. I added the very simple spawn players script.

Show more comments
avatar image frencrus78 · Sep 24, 2021 at 01:50 PM 0
Share

How can i synchronize it?

avatar image miha4406jp frencrus78 · Sep 24, 2021 at 10:46 PM 0
Share

So, 1st client enters the room and creates game object immediately? Then 2nd player joins, he doesn't see this game object? Correct? Then, maybe, problem appears because it's instantiated in absence of this 2nd player. You may need manual instantiation (https://doc.photonengine.com/en-us/pun/current/gameplay/instantiation#manual_instantiation). Or you can use RPC to standard instantiate, but send it to RpcTarget.AllBuffered, so joined clients execute it too.

avatar image miha4406jp frencrus78 · Sep 24, 2021 at 10:54 PM 0
Share

I'm not sure, though. Because i'm always waiting for all clients to join, and only then start anything.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

133 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity Photon 2 only master client can see others players 0 Answers

Client side prediction, rigidbody.velocity, photon network 0 Answers

Photon SceneObject Creating by Client 0 Answers

Photon Instantiate object not disappear after dc master client 0 Answers

set otherplayer as master client when master client leaves room photon 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges