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 Madswint · May 20, 2015 at 11:16 PM · animationnetworkanimationsrpc

Make an animation play over RPC call?

How would I do this, since RPCs cant do animations right? I've looked into it and cant find anything. Thanks 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

Answer by jrjr · May 20, 2015 at 11:56 PM

You could send the commands as enum,strings, or a custom codec depending what kind of network solution you are using.

By custom codec this would be something like an int or string that you parse out later. Example in pseudo code: int mycustomcodec (any number between say 1 and 10)

send rpc with int value 3

remote side receives value of 3

if (rpc value of 3) { animation.play("dance") } else { animation.play("idle") }

You could also use a case/switch statement to break your codec apart which is usually a bit better than if's for organization and understanding (when you have to come back to it 3-4 months later and wonder what you were doing)

This type of 'codec' concept has a wide variety of uses - for example if you make it a string:

rpc send string of "152"

on other end parse your string out to 3 ints (and make sure that's what you're always sending or filter out the garbage)

when you peel the first int of 1, that's what you look like (model choice?), peel the second int of 5 that's your current playing animation (check to see if its already playing, if not - do it), and peel the third int of 2 and that's your weapon wielded (and.. if its not ... wield it).

This is all optional example of course. It can very big time. There are dozens if not hundreds of ways to do it.

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 Madswint · May 20, 2015 at 11:59 PM 0
Share

Hi, thanks for the answer. I'm a student working on a game, I have my exams in a week and I have been frying my brain over this the entire day. I'm using unity's built in networking, right now this confuses me, so I'm going to sleep since I just cant concentrate anymore. I'm going to look at this tomorrow and see if I can work it out. I dont like asking for code, but if you could write a small example, a line or two, for me to comprehend, it would be amazing. Thanks in advance, going to sleep.

avatar image jrjr · May 21, 2015 at 12:17 AM 0
Share

Hmm. Well I wrote up a page for you with 2 code samples and it refused to let me post another answer - I should have used comment :( - it erased it all.

In short go try out http://docs.unity3d.com/$$anonymous$$anual/net-RPCDetails.html

$$anonymous$$ake sure you have 2 clients and a server running that's the $$anonymous$$imum for a unity network setup so you can see what's going on proxy side.

avatar image Madswint · May 21, 2015 at 10:49 AM 0
Share

Hi again. I already looked this, but the RPC confuse me a ton. Could you try and write a small example again? Showing how to "activate" an animation for another player to see.I tried writing it myself, ended up with loads of RPC errors, and when they were finally all gone, nothing happend. Thanks again

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

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

Related Questions

unity network animation problem 0 Answers

Multiple Animation 1 Answer

play animations (multiplayer) 1 Answer

Problem with animation RPC in Photon 1 Answer

Animation Running Game 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