- Home /
Cursor.SetCursur overload error? (Fixed)
I'm getting the weirdest error because the code is directly from the API but it does not work all I did was change the names
Heres the relevant code:
var gamec: Texture;
var greenc: Texture;
Function Update(){
if (Application.loadedLevelName=="menu")
{
Cursor.SetCursor(gamec,CursorMode.Auto);
}
if (Application.loadedLevelName=="AI")
{
Cursor.SetCursor(gamec,CursorMode.Auto);
}
}
And the error is : Assets/Project Files/menu/menu.js(77,25): BCE0017: The best overload for the method 'UnityEngine.Cursor.SetCursor(UnityEngine.Texture2D, UnityEngine.Vector2, UnityEngine.CursorMode)' is not compatible with the argument list '(UnityEngine.Texture, UnityEngine.CursorMode)'.
I can't say anything more but... please help?
PS. I'm making a 3D game if that would cause any issue, also I have experimented with making the "Texture" into "Texture2D" but it still gave me the same error
Answer by steakpinball · Apr 02, 2015 at 01:31 PM
Your variables gamec
and greenc
are of type Texture
, but you need to send Texture2D
to SetCursor
. Change your variables to type Texture2D
.
aparently i needed to add vector2.zero as a middle argument for some reason