Братцы и сёстры, выручайте:
Если Animator отключён, всё работает стандартно(модель в T-pose двигается), если включить, то модель начинает трястись
https://yadi.sk/i/boe9kYEwp5Z-Lw
Если подключить Animate Physics, то модель проваливается, если отключить Use Gravity, то просто стоит неподвижно
https://yadi.sk/d/Kf4-b1CYACoGCQ
Прилагаю также скрипт анимации:
Синтаксис:
Используется csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class Enemy : MonoBehaviour
{
private NavMeshAgent myAgent;
public Animator myAnimator;
// Start is called before the first frame update
void Start()
{
myAgent = GetComponent<NavMeshAgent>();
myAnimator = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.W))
{
// myAgent.enabled = false;
myAnimator.Play("Run");
}
else
{
// myAgent.enabled = false;
myAnimator.Play("Idle");
}
//Debug.Log("Space key was pressed.");
}
}
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class Enemy : MonoBehaviour
{
private NavMeshAgent myAgent;
public Animator myAnimator;
// Start is called before the first frame update
void Start()
{
myAgent = GetComponent<NavMeshAgent>();
myAnimator = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.W))
{
// myAgent.enabled = false;
myAnimator.Play("Run");
}
else
{
// myAgent.enabled = false;
myAnimator.Play("Idle");
}
//Debug.Log("Space key was pressed.");
}
}