im using unity 2018.3.6
Iv created an avatar using UMA and written a script from a YouTube tutorial to make character click to walk.I must be missing something here.
Here are images of animator, error and also script.
any help much appreciated!!!
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);
}
}


@msmoyle did you attached the correct animator controller which is having parameter(running) to the object?
– 28mitu