Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
  • Help Room /
avatar image
0
Question by XBabineOne · Aug 05, 2016 at 02:29 PM · physicsnetworkinganimatornetworkanimator controller

NETWORK: Animator probleme. Unity 4.6.3.f1

Hi!

(I'm french so... sorrry for all mistake inside the text D:)

I have a little probleme in my game. I need animation for animated character and there is a probleme. In clientSide, all animations works, but... in serverSide, It is dosen't work at all! I don't know this probleme. I try to find a solution on google to see if other people have the same probleme than me and nobody have a solution D: I use the ANIMATOR and not the ANIMATION ! all people use animation and not animator. I try this:

 using UnityEngine;
 using System.Collections;
 
 public class AnimationControllerSoldierTest : MonoBehaviour {
     
     private Animator myAnimator;
     
     public float VSpeed = 0.0f;
 
     public float HSpeed = 0.0f;
 
     private GameObject ModelAnimated;
 
     private GameObject PlayerObject;
 
     private Transform myTransform;
 
     public int ChooseRandomAnim = 0;
 
 
     //Set bool for stance.
     public bool running = false;
     
     // Use this for initialization
     void Start ()
     {
         if (networkView.isMine == true)
         {
             myAnimator = GetComponent<Animator> ();
             PlayerObject = transform.gameObject;
 
             myTransform = transform;
             ModelAnimated = myTransform.FindChild ("Swat_Animated").gameObject;
             myAnimator = ModelAnimated.GetComponent<Animator>();
         } else {
             enabled = false;
         }
     }
     
     // Update is called once per frame
     void Update ()
     {
         //Random function.
         //ChooseRandomAnim = Random.Range (0, 3);
         
         //Right & Left; Forward & Backward.
 
         //VSpeed = myAnimator.SetFloat("VSpeed", Input.GetAxis ("Vertical"));
         //HSpeed = myAnimator.SetFloat ("HSpeed", Input.GetAxis ("Horizontal"));
 
         VSpeed = Input.GetAxis ("Vertical");
         HSpeed = Input.GetAxis ("Horizontal");
 
         networkView.RPC("SendFloatHorizontalAndVertical", RPCMode.All, VSpeed, HSpeed);
 
         ModelAnimated.transform.localPosition = new Vector3(0,-1,0);
 }
 
     [RPC]
     void SendFloatHorizontalAndVertical(float VSpeedRPC, float HSpeedRPC)
     {
         myAnimator.SetFloat("VSpeed", VSpeedRPC);
         myAnimator.SetFloat("HSpeed", HSpeedRPC);
         //myAnimator.CrossFade("Walk_forward", 1f, 0, 10f);
     }
 
 }

There is no error in the debugger.

this line: ModelAnimated.transform.localPosition = new Vector3(0,-1,0); is used for replace the player near the floor.

is my RPC is wrong? is my method is wrong? Is my script wrong?

Realy, I don't know. Thanks people if you help me :D

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

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

Related Questions

Animating physics problem 1 Answer

How to implement NetCode to Unity physics (new one, with Havok) 0 Answers

Placing my own animation idle&move to player 0 Answers

Animations are not playing. 1 Answer

What's the best way to set up an animator controller for a character that can look up, down, or sideways? 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