13분에 NavMeshAgent가 바꾼 부분에서 실행이 안되어 지네여
532
11 câu hỏi đã được viết
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)
오류는 이렇게 뜨는데, 비주얼 문법 상에는 문제가 없다고 뜹니다 ㅠ
Câu trả lời 2
UI 기능 관련 질문이 있습니다!
0
26
2
픽셀 좌표 스크린 좌표
0
27
0
전체적으로 코드 읽는게 굉장히 오래 걸리네요...
0
68
2
카메라 #2 수업 캐릭터 쓰러짐 해결
0
80
1
플레이어 움직임이 끝날때, 기울어짐 현상
0
81
1
Input 적용과 관련하여 질문 있습니다.
0
72
1
디버그 불가.. Unity에 연결 불가
0
77
1
달리기 애니메이션 에러
0
85
2
오랜만에 게임을 만들다가 사운드 관련해서 뭔가 궁금한게 있어서 봤습니다
0
63
1
GetKey 오류
0
109
2
에셋을 어디에 올려두신지 알 수 있나요?
0
104
1
재귀호출? 오류나는데 왜 이래요 ?
0
167
6
Animation blending 파라미터 계산
0
65
1
newPos와 to지점이 겹쳐져야 하는거 아닌가요?
0
94
3
오브젝트 복제하니까 자꾸 이런게 뜨면서 꺼집니다
0
85
2
질문있습니다
0
142
2
아 이거 소스코드 같은거 없나요?
0
140
3
질문 드립니다. string.IsNullOrEmpty(name)
0
85
2
@Managers 가 씬에 배치되어 있어도 문제가 되지 않나요?
0
133
2
유니티6 NavMesh 안되는분들
1
174
1
Unity6 Unity-Chan Material 마젠타 문제 해결법
7
524
1
GetComponent<Poolable> 질문드립니다.
0
99
2
UI 불러오지 못함
0
116
2
UI 자동화 #1 - Util.cs의 FindChild함수에서 component.name에 컴포넌트 이름이 뜹니다.
0
152
2

