Question by
unity_EUaR3_TE3Dh7Mg · Apr 30, 2020 at 06:20 PM ·
c#script.unity 2dcharacter movement
My character is animating perfectly but character is not moving when walk .
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Move2d : MonoBehaviour
{
public Animator animator;
// Update is called once per frame
void Update()
{
animator.SetFloat("Horizontal", Input.GetAxis("Horizontal"));
Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), 0.0f, 0.0f);
transform.position = transform.position + movement * Time.deltaTime;
}
}
My transition conditions are: Any-walking 2 :Horizontal less 0 || walking 2-Exit :Horizontal greater -0.001 || Any-walking :Horizontal greater 0 || walking-Exit :Horizontal less 0.001
Comment
Your answer
Follow this Question
Related Questions
Destroying enemy only partially works 0 Answers
Unity job is failed error. 0 Answers
Convert Keyboard controlls to UI Buttons 1 Answer
Making an image appear 0 Answers
Saving an image's state 2 Answers