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 /
avatar image
0
Question by Sherlore · Aug 08, 2016 at 07:55 PM · networkingspritesynchronize

[UNET] Replace sprite for local player's playerprefab through UNET

Hi, I'm Sherlore and I'm new to Unity Answers, so please forgive me if I do anything improper.

Recently, my friend and I need to design a teaching material for our student. To make our students be able to design their own character. We want to make a game that player can have an avatar and meet each other through UNET. And the students can change their avatars' appearance by giving them whole project and teach them how to edit sprite.

Since the students only change the sprite and we don't want to spend time on merging all new avatar into one application, we wish the project and game can work like below

1.Student open project and edit sprite only.

2.export application of one's own.

3.start networking connection

4.the player with local player authority can synchronize new sprite to his/her avatar //The example will be given later.

After some testing, we found if you only edit sprite of the playerPrefab, UNET would still view them as same playerPrefab. So if I export first version and then edit sprite(e.g. change body to red) to export second version, the networking game would like

alt text

And for the example we want to achieve, if left window is the local player of left role and right window is the local player of right role, we want to make left role in left window synchronize his red body sprite to left role in right window and right role synchronize his blue body in opposite way.

I have tried using Command with sprite as parameter. It didn't work. The sample code is

 public SpriteRenderer bodySP;
 
 void Start () 
 {
     if (!isLocalPlayer)
         {
             return;
         }
     CmdUpdateSP(bodySP.sprite);        
 }
 
 [Command]
 public void CmdUpdateSP(Sprite ss)
 {
     bodySP.sprite = ss;
 }

Looking for any good advice. The possible solution or other approaching are all welcome. Thanks!!

擷取-2016-08-09-01-39-56-134.png (444.2 kB)
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

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Sending image data through SyncVar doesn't work (Mirror Networking) 0 Answers

Fliping 2Dsprite over network,fliping 2Dsprite from client to server not updating 0 Answers

Flipping Sprite on Client/Over Network 0 Answers

Flipping sprites in Multiplayer doesn't flip host 2 Answers

Unity Lobby Networking - Change player RuntimeAnimatorController and sync? 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