'showCursor' is not a member of 'Screen'.

I’m wanting to remove the cursor with

function Start () {
Screen.showCursor=false;
}

However I get the above message.

Could it be due to problems with my .NET framework?

I have had problems and got to a point where I have .NET 1.1 and 2, and cant install 3.5 or remove 1.1 and it is all basically stuck. Could this be responsible for missing classes?

Thanks

Unity doesn’t use .NET, it uses Mono and doesn’t depend on external libraries. Screen is part of Unity anyway, not Mono. The actual problem is that you’ve called your script Screen, so Unity is looking for a variable called showCursor in your script. You can differentiate between Unity’s Screen and your Screen, but generally it’s better not to use Unity function names for your scripts.

–Eric

You’re good cause I didnt even give you that information.

Yes stupid me, I even wondered for a while if this was the reason and duh never tried fixing it.

It’s not that uncommon, so don’t feel bad. :wink: Personally I think Unity should probably give a warning in these cases. Usually it’s people calling their gui scripts “GUI” and then their GUI.X calls don’t work. Just for the record you can prepend “UnityEngine.” to differentiate; e.g. use “UnityEngine.Screen” to call Unity’s Screen class and use “Screen” for your script. Obviously that’s a bit of a pain though.

–Eric

Ah neat tip, good for creating very clean code