Block을 인식하게 하고싶은데 계속 Block과 Wall 사이 공간을 클릭하거나 그러면 NullReference가 떠서
왜 뜨는지 뭔가 hit.collider가 null일 때 Debug도 찍어보고 location이 null인가? 해서 debug찍어보고 했었는데
그게 아니라 hit를 false 일 때 return 하게 만들었더니 해결이 되었다.
고치기 전
고친 후
추가된 코드
hit가 false면 return 하게 만들었다.
그랬더니 nullreference가 없어졌다.
도움
https://stackoverflow.com/questions/42788004/physics2d-raycast-returning-null
Physics2D.Raycast returning null
I have a bit of a issue that has me super stumped here. I am going from Key codes , to mouse input - then it later become touch input, but first I want to figure out why i cant do this with just a ...
stackoverflow.com
'워리어 콤보 모작 개발일지' 카테고리의 다른 글
워리어콤보 개발일지 - Stack, LineRenderer (0) | 2023.09.18 |
---|---|
워리어콤보 개발일지 - Block 삭제하기 (0) | 2023.09.17 |
워리어콤보 개발일지 - 좌표찍기 (0) | 2023.09.16 |
워리어콤보 개발일지 - Test [보드생성] (0) | 2023.09.15 |
워리어콤보 개발일지 - 2차원 배열 출력 (0) | 2023.09.14 |