Problem, character is click to walk via script written from tutorial on YouTube.
when i hit play mode both animations begin to cycle in the animator but the run animaton wins out and cycles while character isnt moving.
Im using unity 2018.3.6 and UMA for character
i have a parameter called Running which is set to true for transition to run animation and false for transition back to idle
script here
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class ClickToMove : MonoBehaviour
{
private Animator mAnimator;
private NavMeshAgent mNavMeshAgent;
private bool mRunning = false;
// Start is called before the first frame update
void Start()
{
mAnimator = GetComponent<Animator>();
mNavMeshAgent = GetComponent<NavMeshAgent>();
}
// Update is called once per frame
void Update()
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Input.GetMouseButtonDown(0))
{
if (Physics.Raycast(ray, out hit, 100))
{
mNavMeshAgent.destination = hit.point;
}
}
if (mNavMeshAgent.remainingDistance < mNavMeshAgent.stoppingDistance)
{
mRunning = false;
}
else;
{
mRunning = true;
}
mAnimator.SetBool("Running", mRunning);
}
}