Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

can't switch animation

Discussion in 'Animation' started by cookie_boy99, Aug 18, 2018.

  1. cookie_boy99


    Aug 18, 2018
    i've been trying to make a small game and i'm trying to switch between animations but no tutorials are working. anyone know how to do this? i'm using 5.6.3 thanks

    here's the script i'm using:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class gcanim : MonoBehaviour {

    Animator anim;
    int jumpHash = Animator.StringToHash("Jump");

    // Use this for initialization
    void Start () {

    anim = GetComponent<Animator>();


    // Update is called once per frame
    void Update () {
    float move = Input.GetAxis("Vertical");
    anim.SetFloat("walk", move);


    my walk and idle animations are called walk and idle (obviously -.-)