Inflearn コミュニティ Q&A
13분에 NavMeshAgent가 바꾼 부분에서 실행이 안되어 지네여
作成
·
530
0
void UpdateMoving()
{
Vector3 dir = _destPos - transform.position;
if (dir.magnitude < 0.0001f)
{
_state = PlayerState.Idle;
}
else
{
NavMeshAgent nma = gameObject.GetOrAddComponent<NavMeshAgent>();
float moveDist = Mathf.Clamp(_speed * Time.deltaTime, 0, dir.magnitude);
nma.Move(dir.normalized * moveDist);
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(dir), 20 * Time.deltaTime);
}
Animator anim = GetComponent<Animator>();
anim.SetFloat("speed", _speed);
}
"Move" can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.AI.NavMeshAgent:Move (UnityEngine.Vector3)
PlayerController:UpdateMoving () (at Assets/Scrips/Controllers/PlayerController.cs:49)
PlayerController:Update () (at Assets/Scrips/Controllers/PlayerController.cs:72)
오류는 이렇게 뜨는데, 비주얼 문법 상에는 문제가 없다고 뜹니다 ㅠ
クイズ
Unity 게임 개발 프레임워크에서 Manager를 사용하는 주된 목적은 무엇일까요?
특정 오브젝트의 애니메이션을 제어하기 위해서
자주 사용되는 기능이나 시스템을 중앙에서 관리하기 위해서
캐릭터의 스탯 값을 저장하기 위해서
게임 씬의 배경 음악을 재생하기 위해서
回答 2
0
0





