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
0
Question by Etarnalazure · Jul 31, 2013 at 05:21 PM · prefabmultiplayernetworkrpcstream

Show prefab's children over network

Hello everyone,

So, I want to update the player prefab over the network, I have a playerPrefab that holds all clothing items as children, when the game runs, all children gets hidden unless they have become equipped by doing this;

 private static void HideWristMeshes()
 {
     for (int i = 0; i < _wristMesh.Length; i++) {
             _wristMesh[i].SetActive(false);
     }
 }

I have a method for each item category, all doing the same basic thing.

Now, when the player picks up an item and equips it

 public static Item EquipedWrist
     {
         get{return_equipment[(int)EquipmentSlot.Wrist];}
 set{_equipment[(int)EquipmentSlot.Wrist] = value;
             
         HideWristMeshes();
 
             if(_equipment[(int)EquipmentSlot.Wrist] == null)
 {
     return;
 }
             switch(_equipment[(int)EquipmentSlot.Wrist].Name) {
         case "ElvenArmourWrist":;
         _wristMesh[0].SetActive(true);
         break;
         case "MercWristArmour":
         _wristMesh[1].SetActive(true);
         break;
         case "NordraicWristArmour":
             _wristMesh[2].SetActive(true);
         break;
         case "TemplarWristArmour":
             _wristMesh[3].SetActive(true);
         break;
         }
     }
 }

And this works just fine on the clients side. It shows everything it should and so on, but heres the problem.

I need to send a message to the rest of the players that suddenly the item "ElvenArmourWrist" has been set to "true", and should now be displayed as such.

How do I do this? This is my first try at using Unity's inbuilt networking solution so I am rather new. I have been reading up on as much as possible, but the problem is; I dont know where to apply the different methods and I'm unsure if I understand them correctly.

So I was hoping someone knew a way of updating the playerPrefab as soon as an item has been equipped. I thought that a networkView on the playerprefab would do the trick. But it seems the only thing a NetworkView updates is the rotation and position (Which works).

Hopefully someone can help.

(Ps. Before anyone says I should just network.instantiate the children onto the player as gameobjects, I've tried. The meshes are quite weird and I cannot get them to be positioned correctly. I am using a pre-made 3D model, and when ever I try to position them onto the character from the outside then they wont fit as they should. So I'm left with the only option of sending whether or not the child is visible or not.)

Thank you so much in advance :)

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 Etarnalazure · Aug 01, 2013 at 01:08 AM

Though this is not a "proper" answer, I will give an update on what I did to get it working;

I got a asset pack called "TNet" to solve my problem for me. Unfortunantly, it seems I dont have enough experience to create the server my way. So I took the 'easy' way out.

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

15 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

Related Questions

Problem with RPC attribute. 0 Answers

When to use OnSerializeNetworkView and RPC's 1 Answer

Multiplayer - Selected character to Network.guid? 0 Answers

Network Instantiate PlayerPrefab Problem 2 Answers

get return on networkView.RPC 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