Godot Version
v4.5.1.stable.steam [f62fdbde1]
Question
Hello, I would like to know if its possible to assign a custom shader of type canvas_item to all future create Sprite2D and AnimatedSprite2D so I don’t need to assign it manually every time.
v4.5.1.stable.steam [f62fdbde1]
Hello, I would like to know if its possible to assign a custom shader of type canvas_item to all future create Sprite2D and AnimatedSprite2D so I don’t need to assign it manually every time.
In my opinion, instead of trying to assign this to every new Sprite2D, you should just define / create a custom Sprite2D and AnimatedSprite2D class that inherits Sprite2D and AnimatedSprite2D respectively, mark both your classes with the @tool tag so it runs in the editor, and then simply assign your shader during _init.
That works pretty well actually. Thanks ![]()
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.