TheRestDevelop
Property collider has been deprecated
void
2018. 5. 29. 09:00
에러 : Property collider has been deprecated
1) 수정 전
if(collision.GetComponent<Collider>().CompareTag ("Player")){
StartCoroutine (fall ());
}
2) 수정 후
if(collision.GetComponent<Collider>().CompareTag ("Player")){
StartCoroutine (fall ());
}
참고 : 유니티 공홈
또 다른 에러 발생
MissingComponentException: There is no 'Collider' attached to the "Player" game object, but a script is trying to access it.
You probably need to add a Collider to the game object "Player". Or your script needs to check if the component is attached before using it.
아예 "GetComponent<Collider>()" 메서드로 참고하지 말라는 댓글이 있어서 메서드를 지워보니 해결되었다.
3) 수정 완료 코드
if(collision.CompareTag ("Player")){
StartCoroutine (fall ());
}
참고 : 유니티