Right way to implement Custom Animated Cursor

Godot Version

Godot 4.2

Question

What’s the right way to implement a custom AnimatedSprite2D custom cursor?
I’ve followed a couple of old tutorials on the internet, it works perfectly inside the game, but it completely stops working when used when used with Control nodes/CanvasLayers. The cursor is hidden behind this layer and cannot interact with UI elements, which means this way of making the sprite follow the cursor doesn’t work for overlays.

There must be an alternative solution as someone might have figured this out already, hoping someone can point me in the right direction. I have most of the game done, this particular issue has been holding me back for a long time.

Add the Animated Cursor inside a canvas layer and then if the cursor hidden behind any other canvas layer then make the layer of canvas layer where the cursor is, to higher than 0