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 weenchehawk · Jan 28, 2013 at 12:42 AM · networknetwork.instantiate

How to tell when I've received the Server's state after the client connects

I'm trying to do a simple thing - I want to delay the Network.Instantiate() of my player object until my server finshes sending it's current state at time of connection. Is there an easy way for the client to tell when the Server has sent all of teh objects it has instantiated at the time of the connect. More details below

I have a spaceship game where players can visit different solar systems, each solar system is a separate scene, and each is hosted by a dedicated server / unity instance. The scene content is procedurally generated by the server.

When I start the scene docked, I could be exiting from one of a number of different space stations in the scene, I know which station because I save the station's gameObject.name at the time I dock.

When I undock, I simply do a GameObject.Find() for this GameObject by name, get it's transform and decide how far from it I should Network.Instantiate() my player.

Now . . . when I instantiate my player object, I do so inside a OnConnectedToServer() call, but at the time this is called, I haven't received all my server's procedurally generated content yet, so can't look up the space station in the scene by name.

I suspect I just need to go about this a different way, but would like to know for sure before I do a mid-cycle de-construct and re-construct on my code.

Any help very much appreciated.

Note I I know that the Server "State" is dynamic and will change as other clients connect, that's no treally relevant here because I know that the procedurally generated content is at least instantiated when the server starts.

Note II yes I know that Network.Instantiate will create client objects with Clone names (see here) - I've fixed that with a network rename object. (I'm happy to post it if people want it).

Note III Yes I know I can write my own Network.Instantiate() - I really want to avoid doing that.

Comment
Add comment
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

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

9 People are following this question.

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

Related Questions

Having problems with Network.Instantiate 1 Answer

Network.Instantiate dont instantiate object 0 Answers

Network.Instantiate after loading level? 1 Answer

Network.Instantiate doesn't create player 2 gameobject. 0 Answers

Network rigidbody synchronize 0 Answers


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