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 OmegaDude · Dec 21, 2015 at 05:39 PM · multiplayerplayerspawning

UNET - Players Spawn With Misplaced Authority

Background

I'm new to UNET, but not to multiplayer in general. I'm having some trouble with UNET's basics due to very incomplete documentation. The tutorials/manual pages are more complete, but are not relevant to what I'm trying to do, as far as I can tell (and I've read them through), since they only detail use of drag-and-drop with regard to players, and not any do-it-yourself methods. I'm combining split-screen multiplayer and networked multiplayer.

What's working:

When I spawn players from the host, players spawn fine, have authority, etc. Split screen works beautifully (locally.) And for that matter, all the clients can see the actions undertaken on the host.

My problem:

When I spawn players from any other client, they spawn, I can set their viewports, etc., but they are not given local authority by the server. They only have authority on the server/host (and they shouldn't.) They're only partially controllable on the client that requested them (rotation is deliberately undone by their NetworkTransform since they don't have authority), and the movement isn't transmitted to other clients or the host.

What I'm doing:

I'm using a class that inherits from NetworkManager (CustomNetworkManager) on both the client and the server to coordinate and execute spawning. It is identical for clients and hosts, but I assume that the obvious, premade, server-only functions still only execute on the server. The client (wherever it may be) calls AddPlayer(ClientScene.readyConnection) with a player controller specified. I think that triggers OnServerAddPlayer() on the server, which then instantiates the player on the server and spawns the player for everybody else. And it should give the player local authority on the client that requested it, right?

Where have I gotten it wrong?


(Extra info)

Latest Unity release, 5.3.0f4.

Everything has NetworkIdentities, and the players have NetworkTransforms. I'm using various premade materials right now, such as the first person controller and mouselook.cs.

On the server, the inspector's "Network Information" for each host-spawned player says yes on all counts.

On the clients, the "Network Information" for the client-spawned players say yes for isClient and localPlayer, but not the others (including the one regarding authority.) On the server, the "Network Information" for the client-spawned players says yes to everything but localPlayer.


After working on this for a week, thought I'd reach out to the community. Thanks in advance, and happy holidays.

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
Best Answer

Answer by OmegaDude · Dec 23, 2015 at 02:11 PM

Solved my own problem: A not-so-obvious detail about NetworkIdentities is that any NetworkIdentity on a player object has to have its "Local Player Authority" tag checked in order to work as expected.

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

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to make multiplayer editor/race 0 Answers

HLAPI: How to spawn players from preGameScene 1 Answer

player Spawning Error on Photon (PhotonNetwork.Instantiate) 1 Answer

unity game 1 Answer

Multiplayer problem - 2nd player erratic movment? 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