Post your entire script instead, as this block doesn’t seem to have any problems.
Also, be sure to use code tags .
A couple things to note about “OnCollisionEnter is declared but never used”:
- This is just a warning and not an error; it should not stop you from running your application. But since you are unable to run your application, then you have an error elsewhere.
- This type of warning is directed towards variables you have declared. You probably accidentally created a variable called “OnCollisionEnter” while meaning to type the function “void OnCollisionEnter()”.