Unable to change cursor type

Godot Version

v4.7.2.stable.mono.official [ed1daf0bf]

Question

When player is in game, I’m calling

Input.SetDefaultCursorShape(Input.CursorShape.Cross);

to change cursor from Arrow to Cross (I’ve already applied the styles that I want). The problem is that this line of code does nothing - visually cursor remains an Arrow, and even if you use print to check what type of cursor engine is using, it shows Arrow. So for whatever reason this method is effectively a no-op.

At this point all options are not exhausted. You can change cursor type through GUI on Control level, and every game needs HUD. So you can just change Default Cursor Shape to Cross, and in-game cursor will automatically match what you need, and you don’t have to change it in code for example when pause menu appears.

This sounds all well in theory, but for reasons unknown to me this approach doesn’t work either. I have added transparent ColorRect at the top in my HUD CanvasLayer with Default Cursor Shape set to Cross, and still Arrows displays. There is small progress though - Cross appears only when cursor is at the right edge of the screen. Moving the ColorRect around doesn’t change the area.

There is one extra way that I want to avoid - do not rely on prebuilt cursor types, but dynamically change Arrow texture on runtime. I’ve tested it and it works, but it’s not optimal to say the least.

My first thought is that there may be controls in the scene that are overriding the default cursor shape. The default cursor shape is just that, a default that can be overridden.

I’ve figured that out before your comment but I forgot to update, but it is the real answer so I will mark it as solution.

Order of CanvasLayers is irrelevant to each other, only Layer matters. But if you have Controls outside of CanvasLayers, then order matters. So all you have to do is to move HUD CanvasLayer that has the Control with different cursor type to the highest priority.