since the Unity 5.4 update my console is being spammed with an endless stream of the warning “Invalid texture used for cursor - check importer settings”.
Yes, I’ve got a custom cursor, and it’s changing every now and then using the UnityEngine.Cursor.SetCursor() method. It still works great, if it wasn’t for the warnings spamming my console.
The importer settings of the Cursor-images are the same I use for many other sprites that render well and do not throw warnings:
TextureType: Sprite (2D & UI)
SpriteMode: Single
PackingTag:
Pixels per Unit: 100
Pivot: Center
Generate Mip Maps: no
FilterMode: Bilinear
Currently no platform-dependent overrides.
Also, the images are 64x64px, so they are square and divisible by 2 as well as by 4. Not that it would/should be required, but still…
Does anybody have an idea as to why these warnings happen? Is it a bug or what could be wrong with my cursor textures?
Obviously this is a very late reply, but these are the import settings that are checked to generate this error:
Format is ARGB32
The texture is readable
alphaIsTransparency is true
The texture is not mipmapped
If you’re generating textures at runtime, you would have to set “alphaIsTransparency” to true after constructing the texture, but because of this bug, you’ll need to wrap that in an #if UNITY_EDITOR block. This is fine because the warning does not appear in the standalone.
You, sir, was very helpful! How am I supposed to know that after setting a cursor texture type to “Cursor” it wouldn’t work as a cursor unless I changed a parameter in advanced without you?
Hey Pan (and anyone in the future reading this), I found these settings fixed the issue, you might want to start with them and see if you can’t use a cursor texture, then at least you’re heading in the right direction to get the issue fixed:
Make sure the settings are exactly as you see them here, it should resolve the error!