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
0
Question by PylonCrow · Mar 24, 2017 at 03:44 AM · networkingplayernetworkspawningclient-server

IS it possible to have delayed player spawning after server connection? (UNet)

I feel like this is a stupidly simple question, but ive searched for 2 days now and found nothing just to perform this simple task.

Overview of what I'm trying to do: I want both players to connect, select character and THEN SPAWN THE CHARACTERS. I do not want the player character to be spawned when the player connects. This seems extremely simple but due to everything beind inside a magic black box for server/client callbacks when players connect this just isn't happening.

Here's what I've tried so far:

   public override void OnServerConnect(NetworkConnection conn)
     {
         Debug.Log("Player " + iNumActivePlayers + " connected from " + conn.hostId);
         connections.Add(conn);
         base.OnServerConnect(conn);
     }

store the connections in a list of connections when someone connects. then when i click a button on the HOST I want all clients to spawn their own characters. and have them play out as if they spawned instantly on connection

Is the only way to do this by adding another game object to the scene, give it a new scripts that inherits networkbehaviour and have that call ClientScene.AddPlayer() ? via [Command] and [RpcClient] functions?

I feel like i'm not understanding something about this behavior or i'm not overriding functions properly.

Any help would be appreciated literally every single tutorial for this is barebones " spawn the player instantly when people connects" and every other question ive seen on this still is instant spawning.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Halfbiscuit · Mar 24, 2017 at 10:52 AM

On our project we have "Dummy" player objects which store basic data about the connected clients. These are then spawned on connection. Then later on we spawn the actual player character using this data.

Comment
Add comment · Show 2 · 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 PylonCrow · Mar 24, 2017 at 02:40 PM 0
Share

$$anonymous$$akes sense. But say my actual player has like 7 scripts that need initialization and a certain mesh hierarchy. and the dummy is just an empty gameobject with some script holding logic with a network identity attached as well. how would i go about replacing the actual "player" in reference to the network manager's "player" for the character, such that it operates the same, i.e: both players see it but only the respective clients control it?

avatar image Halfbiscuit PylonCrow · Mar 24, 2017 at 02:52 PM 0
Share

We are using a do$$anonymous$$ant server model so we send inputs across via command functions on the dummy player and move the 'actual player' accordingly on the server. I believe there is a way to give specific client authority on non player network objects (on the network identity object?),which may get you closer to your goal.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to watch in client applications what it is happening in the server one? 0 Answers

What is the CCU of the default Unity Networking? 1 Answer

Only host client is able to spawn objects 0 Answers

Since switching to using offline & online scenes in the NetworkManager, Clients will not sync (UNET) 0 Answers

Network Game Player reference 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