# Animator script not working

**URL:** https://discussions.unity.com/t/animator-script-not-working/925809
**Category:** Animation
**Tags:** Animation, Performance, Bug
**Created:** [August 8, 2023, 9:50pm UTC](https://discussions.unity.com/t/animator-script-not-working/925809 "2023-08-08T21:50:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![That\_Dude111](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@That\_Dude111](https://discussions.unity.com/u/That_Dude111)
#### Post date: [August 8, 2023, 9:50pm UTC](https://discussions.unity.com/t/animator-script-not-working/925809/1 "2023-08-08T21:50:47Z")

</div>

I’ve tryed hard for the last few days trying to fix what is wrong with my walking + animation script. I’ve tryed every recent tutorial on youtube but nothing has worked.

```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player_controler1 : MonoBehaviour
{
  
    public float movSpeed;
    float speedX, speedY;
    Rigidbody2D rb;
    public Animator animator;
    Vector2 movement;
  
  

    void Start()
    {
       rb = GetComponent<Rigidbody2D>();
    }

    void Update()
    {
        speedX = Input.GetAxisRaw("Horizontal") * movSpeed;
        speedY = Input.GetAxisRaw("Vertical") * movSpeed;
        rb.velocity = new Vector2(speedX, speedY);

        animator.SetFloat("Horizontal", movement.x);
        animator.SetFloat("Vertical", movement.y);
        animator.SetFloat("Speed", movement.sqrMagnitude);
    }

}

```

---

<div class="post-metadata">

### Author: ![That\_Dude111](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@That\_Dude111](https://discussions.unity.com/u/That_Dude111)
#### Post date: [August 8, 2023, 10:06pm UTC](https://discussions.unity.com/t/animator-script-not-working/925809/2 "2023-08-08T22:06:07Z")

</div>

There is also a warning message that says " The referenced script on this Behavior (Game Object 'Player\_0) is missing!"

---

<div class="post-metadata">

### Author: ![ijmmai](https://avatars.discourse-cdn.com/v4/letter/i/8797f3/32.png) [@ijmmai](https://discussions.unity.com/u/ijmmai)
#### Post date: [August 10, 2023, 7:25am UTC](https://discussions.unity.com/t/animator-script-not-working/925809/3 "2023-08-10T07:25:28Z")

</div>

The missing script seems to be the error. Check Player\_0 to find out what is missing.  
If you want to know if a script you think is running, is actually running, put a debug message in the Start() function.
