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 DaveA · Jul 01, 2010 at 09:37 PM · animationfpsnetwork

FPS player animation state, networked

Probably simple, but I'm new to this: I've got an FPS multiplayer, and I want to set the walk/idle/etc anim states on the players over the net. Currently (with apparently no consideration for network), if my 'local' player is walking, all connected players will 'walk' too. Other players can move all they want but never leave the initial 'idle' state on my (server/host) copy.

Is it as simple as adding a NetworkView? And/or do I need to send the anim name string around?

Any tutorials or examples you might point me to would be great.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by appels · Jul 01, 2010 at 10:15 PM

you can set a networkview to watch the animation or use rpc's.

Comment
Add comment · Show 6 · 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 DaveA · Jul 02, 2010 at 12:00 AM 0
Share

I already have a NetworkView to sync position/orientation. Would I another one, or use the same one? It's watching a script....

avatar image DaveA · Jul 07, 2010 at 01:13 AM 0
Share

Ok I tried the RPC, no luck. Doing something wrong?

[code]

function Update() { ......

 if (lastAnim != anim || lastSpeed != speed)
 {
     networkView.RPC ("SetPlayerAnim", RPC$$anonymous$$ode.Others, anim);
 }

}

@RPC function SetPlayerAnim (anim : String) { Debug.Log("got me an anim "+anim); go.animation.CrossFade (anim); }

[/code]

I never see the remote player's anim change, I never see the debug msg in the console.

avatar image appels · Jul 07, 2010 at 09:52 AM 0
Share

yes, add another networkview and set it to watch the animation and then try again. This is my rpc : @RPC function DoAnimation(actionName : String) { if(!networkView.is$$anonymous$$ine) animation.wrap$$anonymous$$ode = Wrap$$anonymous$$ode.Loop; animation.CrossFade(actionName); }

I pass the wanted animation in the rpc and it gets played on the remote character.

avatar image DaveA · Jul 07, 2010 at 06:45 PM 0
Share

Still no luck. I guess I'm unclear as to what you mean 'set it to watch the animation' How is that done?

avatar image DaveA · Jul 07, 2010 at 10:43 PM 0
Share

Perhaps I should be watching the FPSWalker script? Would I need to expose the speed and stuff on that?

Show more comments
avatar image
0

Answer by berserker · Sep 06, 2010 at 01:23 PM

i have same problem and i dont know how to solve this problem. Just i dont have animation. When i my player moving, other player moving too. if i switch to other client player refreshed and moving to original position. Can anyone help me to solving this problem?

Best regards.

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 DaveA · Sep 07, 2010 at 04:30 AM 0
Share

That's not an anwser, should have been added as a comment

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

No one has followed this question yet.

Related Questions

Animation not showing when close up 1 Answer

Mecanim animation over network - uLink 0 Answers

Lerping Field Of View is buggy 1 Answer

C# Cant get correct speed value from gameobject 0 Answers

gun bob and jerk animation 2 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