# Animation problem or bug.

**URL:** https://discussions.unity.com/t/animation-problem-or-bug/501265
**Category:** Animation
**Tags:** Scripting
**Created:** [April 1, 2013, 3:29pm UTC](https://discussions.unity.com/t/animation-problem-or-bug/501265 "2013-04-01T15:29:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RoDester](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@RoDester](https://discussions.unity.com/u/RoDester)
#### Post date: [April 1, 2013, 3:29pm UTC](https://discussions.unity.com/t/animation-problem-or-bug/501265/1 "2013-04-01T15:29:46Z")

</div>

I really dont get it in my other script it work all right but I have the same code for an other object and it doesnt run.

Heres the code

```auto
var gunModel : GameObject;
var animationRun : AnimationState;

Function Start(){
animationRun = gunModel.animation["Run"];
animationRun.layer = 1;
animationRun.wrapeMode = WrapeMode.Loop;
}

Function Update(){
animationRun.speed = 1;
}

```

Code works, there is no script error what so ever, but the animations doesnt play that what I dont get.

Hope somebody knows something about it.

Cheers!.

P.S Ok so I think I found my problem it haven to do that the speed only works on the defualt animation, how would I play non defualt animations using speed?

---

<div class="post-metadata">

### Author: ![Vein](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vein](https://discussions.unity.com/u/Vein)
#### Post date: [April 2, 2013, 6:21pm UTC](https://discussions.unity.com/t/animation-problem-or-bug/501265/2 "2013-04-02T18:21:16Z")

</div>

Have you tried something like this? `animation.Play("Run");`

---

<div class="post-metadata">

### Author: ![RoDester](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@RoDester](https://discussions.unity.com/u/RoDester)
#### Post date: [April 3, 2013, 12:23am UTC](https://discussions.unity.com/t/animation-problem-or-bug/501265/3 "2013-04-03T00:23:19Z")

</div>

Yes, but with speed with the input I can stop the animation the exact moment I stop the input so it doesnt have to wait until the animation is ended.
