- Home /
Answer by whydoidoit · Jun 18, 2013 at 08:01 PM
Simple answer is you can't! That's because there could be many animations playing.
You can check individual animations using animation["someAnimation"].enabled && animation["someAnimation"].weight > 0 or Animation.IsPlaying("someAnimation").
I want to make a stream and I have to detect animation but i cant use if statement I think u saying you should use like this: but if I use "if statement" Im getting so complicated error on my script
if (animation["someAnimation"].enabled && animation["someAnimation"].weight > 0)
{
}
I used like this:
stream.SendNext(transform.Find("base$$anonymous$$ale").animation.isPlaying("basemeleeattack1"));
and this:
if(transform.Find("base$$anonymous$$ale").animation.isPlaying("basemeleeattack1"))
{
stream.SendNext("test");
}
but im getting an error: Assets/DemoVikings/Scripts/ThirdPersonNetworkVik.cs(52,78): error CS1955: The member `UnityEngine.Animation.isPlaying' cannot be used as method or delegate
I tried many variation the problem is: animation.isPlaying("basemeleeattack1")
"stream.SendNext" is a method of Photon Unity Networking. What should I do now Im confused.
O$$anonymous$$G Im so sorry, it work great thanks. But i have still a little problem.
if(transform.Find("base$$anonymous$$ale").animation.IsPlaying("basemeleeattack1"))
{
Debug.Log("animation playing");
stream.SendNext("test");//what should I send to target, target is an object variable
}
I wrote my question to code as a comment line. Her is the some samples of Photon Stream:
stream.SendNext(transform.position);
stream.SendNext(transform.rotation);
stream.SendNext(rigidbody.velocity);
Your answer
Follow this Question
Related Questions
Retrieving the name of the animation currently playing 9 Answers
Get the scripts name 2 Answers
Walking Animation 1 Answer
texture "animation" sync with character problem [PAID] 0 Answers
Play animation in child model 0 Answers