I keep getting this error when I do add component > make the cursor code

Assets/SampleScenes/Menu/Scripts/PauseMenu.cs(58,20): error CS0117: Cursor' does not contain a definition forvisible’

And in one case, it’s also giving me this error as well

“There are inconsistent line endings in the ‘Assets/Cursor.cs’ script. Some are Mac OS X (UNIX) and some are Windows.
This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.”

Is the error that I am getting for the Raycasting part of the RPG Unity tutorial. Could anyone please help me?

Hi

Same questions have been asked before. Check this link:

Regarding your first question:

Here is what I found:
http://forum.brackeys.com/thread/cursor-does-not-contain-a-definition-for-visible/
https://answers.unity.com/questions/1256496/cursor-does-not-contain-a-definition-for-lockstate.html

Seems like you named your script Cursor, and that confuses Unity, because it internally has Cursor script already, so it tries to reach to Cursor’s visible property but your class does not have this property.
So just rename your script to something else
I hope that helps you

1 Like

Thank You.

Privacy & Terms