Dreaming Deve1oper

[Error] can't add script 해결 본문

유니티

[Error] can't add script 해결

주현테크 2022. 1. 22. 00:08

 

C# Script를 오브젝트에 컴포넌트 할 경우 해당 오류가 뜨는 경우가 있다.

 

Can't add script component "blahblah" because the script class connot be found. Make sure that there are no compile errors and that the file name and class name match.

 

 

 

이는 위 사진과 같이 C# Script 내의 class 이름과 C# Script의 파일 이름이 동일하지 않아 발생하는 문제이다.

필자는 Script의 이름이 test, class 이름이 example이기 때문에 오류가 발생했다.

 

 

이렇게 C# Script와 Class 이름을 동일하게 맞춰주면, 문제를 해결할 수 있다!

 

Comments