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
1
Question by Gravijta · Jun 11, 2015 at 06:57 PM · networkingunity5rpcmasterserver

Unity.Networking (UNet) RPC to Specific Player? Master Server?

Just a couple of questions in regards to the new UNet system.

First, is it possible to send an RPC to a specific player? For example I have a chat system which allows sending messages to everyone, a specific group like a clan or party, or whispering to a single player. Is this done with the [Command] and [ClientRpc] attributes or with SendToClient()? If any one has any general pointers I would greatly appreciate it!

Also my second question: My game currently relies on a masterserver. Is there a masterserver aspect to UNet, or only direct connect?

Thanks!

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

4 Replies

· Add your reply
  • Sort: 
avatar image
7

Answer by seanr · Jan 06, 2016 at 06:27 PM

There is a "TargetRpc" being added to UNet that does this - probably in 5.4

Comment
Add comment · Show 3 · 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 softrare · Feb 26, 2016 at 01:00 PM 0
Share

Thank you for this info, sir!

avatar image Grench1 · Dec 31, 2016 at 09:02 PM 0
Share

Hello I have a problem, I want to sync a component betwen host and client but I dont found the way, I tried to use [command] to get the current state of a GameObject and return it to the client so he can "refresh" his component but that doesnt works because I have to set the return type to void so I dont know what I have to do Please Help!

avatar image ShawnFeatherly · Apr 05, 2017 at 01:44 AM 0
Share

[TargetRpc] was added in Unity3D 5.4. https://docs.unity3d.com/ScriptReference/Networking.TargetRpcAttribute.html

avatar image
1

Answer by Ashkan_gc · Jan 04, 2016 at 08:35 AM

Currently ClientRPCs will be sent to all clients and not only one of them. This is a good feature to be added however. In Client if you want to receive only at owner side you can check isAuthority to see if you should process the call or not but it means everyone will receive it and only owner processes it.

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
avatar image
0

Answer by ThePCJakub · Dec 31, 2016 at 06:47 PM

https://docs.unity3d.com/ScriptReference/Networking.TargetRpcAttribute.html

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
avatar image
0

Answer by tanoshimi · Jun 11, 2015 at 07:22 PM

To send a message to a particular client: http://docs.unity3d.com/ScriptReference/Networking.NetworkServer.SendToClient.html

For MasterServer-type functionality, see: http://docs.unity3d.com/Manual/UNetInternetServicesOverview.html

Comment
Add comment · Show 3 · 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 Gravijta · Jun 11, 2015 at 07:37 PM 0
Share

Thank you very much for your reply! I had a hunch SendToClient would be the way to go... I'll give this a shot when I get a chance. I don't think the internet services will work for me. I plan on having multiple servers with a maximum of 500 clients connected on each.

avatar image tanoshimi · Jun 11, 2015 at 07:53 PM 0
Share

If I'm honest, I'm still getting my head around uNet myself... if you do solve your problem be sure to post back here and let us know!

avatar image meat5000 ♦ · Jul 20, 2015 at 12:48 PM 0
Share

There is also this

SendToClientOfPlayer.

NetworkClient hold the opposite function to SendToClient

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

8 People are following this question.

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

Related Questions

NetworkManager auto deleting client gameobject when calling it 1 Answer

Easy way to make my own Simple Master Server? 0 Answers

UNET - Why is my NetworkInstanceID equal on both clients when receiving ClientRpc? 1 Answer

Unet network message or Command/RPC 0 Answers

ClientRPC not getting sent. 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