Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by NanoEngine · Mar 23, 2017 at 05:08 PM · networkinginstantiatephotoninstantiate prefab

PhotonNetwork.Instantiate is not "buffered"

Hello, I'm currently creating simple multiplayer first person shooter using PhotonNetwork engine, but I got crushed into the problem.

The problem I have is this:

I spawn Player1 using Manager by (PhotonNetwork.Instantiate)

I spawn Player2 using Manager by (PhotonNetwork.Instantiate)

but the problem is player1 can see player2, but player2 cannot see player1. I figured it out that it's not "buffered" Is there a way to solve this problem?

Comment
Add comment · Show 10
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 ChristianSimon · Mar 28, 2017 at 08:21 AM 0
Share

Hi,

PhotonNetwork.Instatiate(...) is buffered, so there shouldn't be a problem with that. Do you use the group parameter of the function (the last one) with any value else than 0 in one of these cases? In this case you need to set sending and receiving enabled for all clients.

avatar image NanoEngine · Mar 29, 2017 at 07:02 PM 0
Share

$$anonymous$$y group parameter is "0" Here is my piece of code where I instantiate the object:

 player = (GameObject)PhotonNetwork.Instantiate("myPlayer", Vector3.zero, Quaternion.identity, 0);
avatar image NanoEngine · Mar 30, 2017 at 07:09 PM 0
Share

I thought I did solved the problem, but I didn't. I'm still having this problem. Please someone help me. The thing is whenever I try the photonnetwork.Instantiate in my "test project", and it worked. I think there is something with my script...

         player = (GameObject)PhotonNetwork.Instantiate("myPlayerClassInit", new Vector3(0, 10, 0), Quaternion.identity, 0);
         player.GetComponent<LobbyPlayerSetup>().enabled = true;

This is litterly what I have in void Start() method... Please help me

avatar image ChristianSimon · Apr 03, 2017 at 08:41 AM 0
Share

You can try moving the Instantiation call from the Start() function to a OnJoinedRoom() callback. This makes sure that the client has definitely joined the room.

Can you tell us what happens in LobbyPlayerSetup script / component? I am also a bit confused about this name, because there are differences about the lobby and the room.

avatar image NanoEngine · Apr 04, 2017 at 03:20 PM 0
Share

Ok, in LobbyPlayerSetup, it's where I change the name of an object that I instantiated. I used simple GetComponent().RPC("ChangeName", PhotonTargets.AllBuffered, username); and there is no problem with it.

I'll explain you the scene. So basically, I''m trying to make a class selection scene. When ever the player gets into the room, I instantiate an object to the class selection scene, and in that object, there are some variables such as "current Class" or which $$anonymous$$m i'm belonging. And I made sure that instantiation call is called AFTER when player joined room. I checked using simple "ConnectionStateDetailed", and I even gave a little bit of delay using StartCorutine, and tried "OnJoinedRoom".

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

103 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

Related Questions

PUN2 Chess game instantiation problem 2 Answers

How to assign Photon Instantiated object's public functions to a gui button events such as OnPointerEnter 1 Answer

[Help] Problem instantiatedObjects Chang Scene from Lobby(Photon) 0 Answers

Networking already instantiated assets 1 Answer

Photon Network Instantiate Objects over Network 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