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 /
This question was closed May 13, 2014 at 12:28 PM by Cerbion_ for the following reason:

The question is answered, the (kinda) right answer was accepted

avatar image
0
Question by Cerbion_ · Jul 26, 2013 at 05:51 PM · c#networkingrpcsynchronization3dtext

Unity Networking synchronize 3DText's

Hello guys, I am currently stuck working on a 2D game, a little bit like 'realm of the mad god' but that's not important, the important thing is, I am instatiating a character (from a Prefab) and it's working fine with the "NetworkView" in-built component from unity, however, I like to synchronize a players nametag and the chat below as well, but I just can't think of a proper way to do so in Unity (It`s my first time in Unity making something for Network).

Here's how I call the NameTag Change from the mainscript:

 CharacterScript.SetTag(playerName, level);

Here's the script from inside the CharacterScript:

 public static void SetTag(string name, int level)
 {
     playerLevel = level;
     playerName = name;
 }


So, how can I synchronize this that it's being changed for every user (not just for each client)

(If you don`t really get what I am trying to achieve, imagine in RPG`s where you have the playerlevel above each player, that`s what I want, well and more..)

Any help is appreciated. :)

Comment
Add comment · Show 2
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 hubbyo9 · Jul 26, 2013 at 06:08 PM 0
Share

isnt every client a user?

avatar image Cerbion_ · Jul 27, 2013 at 08:24 AM 0
Share

Sorry, what I meant is, that currently only your own 3DText is gonna change, the 3DText from any other users remain the default variable. :I

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by perchik · Jul 26, 2013 at 06:17 PM

I would make SetTag an RPC function:

 [RPC]
 public void SetTag(string name, int level)
 {
      playerLevel= level;
      playerName = name;
 }

and call it :

 networkView.RPC("SetTag", RPCMode.All, pName, pLevel);

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 Cerbion_ · Jul 27, 2013 at 09:08 AM 0
Share

Yeah I figured it would work with RPC`s but I tried the following:

 networkView.RPC ("UpdateLabels", RPC$$anonymous$$ode.All);


within the CharacterScript (which is attached to the player prefab)

But as a result it changes everyone`s 3Dtext to the same, it`s always the playername of the player connected above everyones head, (example, if the player's name is "George" every other player has "Lv1 - Goerge" above his head, but on another player`s screen, whose name is "Steve", there would be "Lv1 - Steve" above each players head.. very confusing :I

Follow this Question

Answers Answers and Comments

17 People are following this question.

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

Related Questions

SyncVar issue 0 Answers

Networking Sync SetActive Not Working 0 Answers

Animating online users sprite 0 Answers

[Error] RPC function undefined in IRRELEVANT file? 0 Answers

Can I use Rpc Calls and Commands on the same object? 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