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 /
This question was closed Aug 28, 2017 at 10:24 PM by Manlishpotato for the following reason:

I didnt get a good answer to my question, i have asked around on a couple of other places and still no answer. I have since moved on

avatar image
2
Question by Manlishpotato · May 16, 2017 at 04:40 AM · c#networking

How do I Assign client authority to a gameobject?

How do I if some variable returns true, give client authority or is it at all possible? I know that it is possible to spawn a object with client authority (https://docs.unity3d.com/ScriptReference/Networking.NetworkServer.SpawnWithClientAuthority.html), but that doesn't help here. The object i want to assign authority to is a object that you can shoot and i want to destroy the object afterwards, but this isn't possible if the client is the one to shoot the object. I think the answer may lay in (https://docs.unity3d.com/ScriptReference/Networking.NetworkIdentity.AssignClientAuthority.html) but im not sure how to use it.

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

  • Sort: 
avatar image
0

Answer by adipatil3517 · May 16, 2017 at 05:08 AM

Add network identity to player then check the Local Player Authority in network identity then in script check condition if(isLocalPlayer) { .... // here goes your shooting code} . also do not forget to add using UnityEngine.Networking ; and Instead of MonoBehaviour use NetworkBehaviour then you will get player on server and "isLocalPlayer " will check that player is Local or not and if it is Local it will shoot the object

Comment
Add comment · Show 1 · 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 xancrazy · Aug 27, 2018 at 12:45 PM 0
Share

Hi, I am trying to do this. What you have suggested I have already tried and does not work for me :(

Follow this Question

Answers Answers and Comments

8 People are following this question.

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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

[UNET] Only spawn certain server objects on local client? 0 Answers

C# How to have a toggle 1 Answer

Network how to send data/activate function 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