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 30, 2013 at 02:11 PM · networkingprefabprefab changing at runtime

Display equipment over network

Short version: I want to sync up each player prefab with the dummy prefab that represents the player on the other player's screens.

Long version:

Hello everyone! After having looked around for a while I decided to ask here since then I can check back here once in a while whilst I continue to search for an answer and thus make most of my time.

My question is this; How do I display what gear is equipped over the network?

Currently all gear is placed on my character and disabled, the way I show what gear the player is wearing is by enabling the wanted item when it has been equipped (I have a rather large system for this, but the basic thing is; The player double clicks an item in his inventory, it gets set to ".SetActive(true)" and it gets enabled in the scene.)

Now, this works in single player, but currently I'm migrating all my scripts and such to a multiplayer solution since that was my goal all along. But currently when I equip gear it gets;

  1. shown on the other player connected. (It does not get shown to the other player, it just equips it on the dummy representing the other player in the game world)

  2. not displayed over the network, so even if I manually go in and enable the gear on the character (In the editor) the new prefab look does not get sent over with the networkView

I apologize if I am confusing, unfortunantly I lack the proper know how of Unity's networking protocols to be able to explain more eloquently.

But the basic idea is;

I want to show the new look to everyone else connected to the server and currently, it does not.

If you need scrips or anything similiar please do say so I will post the relavant code if needed.

Thanks in advance to all your awesome people taking your time to help :)

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 jacobschellenberg · Jul 30, 2013 at 05:50 PM

RPC Buffer is perhaps exactly what you are looking for. Buffered RPC calls mean that any new user will receive the update upon connecting.

Comment
Add comment · Show 5 · 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 Etarnalazure · Jul 30, 2013 at 06:03 PM 0
Share

The problem is, it needs to update whilst the players are already connected. Because currently, I have a system where the player can equip items, it works by activating childobjects on the player that started out as non-active. So when they equip a sword or something like that, the sword child gets the "_swords[10].SetActive(true);", thus showing the sword as it should. But the problem is that the sword only shows on the client's side. Not server side.

avatar image Etarnalazure · Jul 30, 2013 at 06:07 PM 0
Share

I was sort of hoping I could do something similiar to what I did with the animation ($$anonymous$$aking a NetworkView and just dragging the Animation onto it) - Also, thank you very much for helping. Been stuck on this the entire day.

avatar image jacobschellenberg · Jul 30, 2013 at 06:15 PM 0
Share

Network.Instantiate may be another option than. Ins$$anonymous$$d of turning the weapon on or off, you could Network.Instantiate it into the proper place. Honestly though, calling an RPC'd method should do the trick because the RPC is called for all connected on the network. However, give Network.Instantiate a try.

avatar image Etarnalazure · Jul 30, 2013 at 06:34 PM 0
Share

Thank you, I was hoping I didnt have to instantiate since its 89 different items thats on the character. I will put your answer as the correct one when I've verified the method.

avatar image Etarnalazure · Jul 30, 2013 at 11:09 PM 0
Share

Unfortunantly I cant use the method you suggested. After spending 3-4 hours playing around with trying to get my meshes to be placed correctly I've finally given up and I will try and find another way of updating the prefab. Thank you for your help regardless.

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

16 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

Related Questions

How to fix OnObjSpawn netId: 1 has invalid asset Id when using Lobby example in existing project 0 Answers

Instantiated objects not showing on new clients [uNet] 1 Answer

I have problem with synchronize multiplayer player position... 0 Answers

Changing the variable 'power' of ONE turret instead of ALL turrets 1 Answer

Prefabs spawn with wrong values 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