13분에 NavMeshAgent가 바꾼 부분에서 실행이 안되어 지네여
534
작성한 질문수 11
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)
오류는 이렇게 뜨는데, 비주얼 문법 상에는 문제가 없다고 뜹니다 ㅠ
답변 2
비쥬얼 스튜디오에서 unity연결이 없습니다.
0
38
2
UI 기능 관련 질문이 있습니다!
0
46
2
픽셀 좌표 스크린 좌표
0
35
0
전체적으로 코드 읽는게 굉장히 오래 걸리네요...
0
82
2
카메라 #2 수업 캐릭터 쓰러짐 해결
0
86
1
플레이어 움직임이 끝날때, 기울어짐 현상
0
85
1
Input 적용과 관련하여 질문 있습니다.
0
75
1
디버그 불가.. Unity에 연결 불가
0
84
1
달리기 애니메이션 에러
0
90
2
오랜만에 게임을 만들다가 사운드 관련해서 뭔가 궁금한게 있어서 봤습니다
0
66
1
GetKey 오류
0
113
2
에셋을 어디에 올려두신지 알 수 있나요?
0
108
1
재귀호출? 오류나는데 왜 이래요 ?
0
169
6
Animation blending 파라미터 계산
0
69
1
newPos와 to지점이 겹쳐져야 하는거 아닌가요?
0
97
3
오브젝트 복제하니까 자꾸 이런게 뜨면서 꺼집니다
0
88
2
질문있습니다
0
143
2
아 이거 소스코드 같은거 없나요?
0
143
3
질문 드립니다. string.IsNullOrEmpty(name)
0
88
2
@Managers 가 씬에 배치되어 있어도 문제가 되지 않나요?
0
136
2
유니티6 NavMesh 안되는분들
1
176
1
Unity6 Unity-Chan Material 마젠타 문제 해결법
7
534
1
GetComponent<Poolable> 질문드립니다.
0
103
2
UI 불러오지 못함
0
119
2





