Hi all!

I'm very new to Godot, and I'm facing a problem a don't know how to solve. I made a character combining an animated sprite and a cloak moved programatically with the movement of my character. I want to make a shader to outline both elements but I can't seem to find how to do it.

My tree is something like:

  • World
    -- TileMap
    -- Player
    ---- Cloak (Node2d)
    ---- CharacterBody2d
    ------ CollisionShape
    ------ Sprite
    ------ AnimationTree
    ------ AnimationPlayer

So, what's the best approach to do this? I tried with viewports (but I think i need to duplicate my player to mimic the sprite and the animations) and I tried the new canvasGroup but without success...

thank you in advance,

Lethn

Thank you! But this is not what I was looking for. I have an animated sprite in combination with a node2d, I need/want a shader to outline both at the same time. If I apply a shader to my sprite it will outline the character but not the cloak because it's in a different node. And I don't want to outline both separately...

    You should be able to use a CanvasGroup to draw all your AnimatedSprite2D nodes with your Node2D nodes, and then apply the shader to the CanvasGroup. Then I think it should outline all of it in a single pass as if it is a single texture.

    dawis As @TwistedTwigleg points out, you should be able to apply the shader to it all at once even if the CanvasGroup method doesn't work, just a matter of keeping the outline settings exactly the same.