this post was submitted on 04 Aug 2025
9 points (100.0% liked)
Godot
6964 readers
5 users here now
Welcome to the programming.dev Godot community!
This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.
Make sure to follow the Godot CoC while chatting
We have a matrix room that can be used for chatting with other members of the community here
Links
Other Communities
- !inat@programming.dev
- !play_my_game@programming.dev
- !destroy_my_game@programming.dev
- !voxel_dev@programming.dev
- !roguelikedev@programming.dev
- !game_design@programming.dev
- !gamedev@programming.dev
Rules
- Posts need to be in english
- Posts with explicit content must be tagged with nsfw
- We do not condone harassment inside the community as well as trolling or equivalent behaviour
- Do not post illegal materials or post things encouraging actions such as pirating games
We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent
Wormhole
Credits
- The icon is a modified version of the official godot engine logo (changing the colors to a gradient and black background)
- The banner is from Godot Design
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
color_rect.set_instance_shader_parameter
should work, as long as thecolor_rect
is unique to each instance of the card, rather than being reused. If you assigned it in the node editor you could check the "Local To Scene" checkbox. Assuming cards are defined as separate scenes you instantiate. Otherwise you couldduplicate()
the resource in code.The same would be true for
color_rect.material.set_shader_parameter
for theShaderMaterial
. If you could ensure it's unique per card, it should work. However, duplicating the material might not be as ideal, especially since the other option is also available.A little tip: You could try print debugging with the
get
functions before and after you useset
to see what the value was before (and notice that it might be the same as the previousset
call from another card) and that it was correctly set afterwards. (Assuming I'm correct about diagnosing the problem.)edit: Actually, my advice is only true if
color_rect
was a resource, but I think it's a node, specifically a sub-class ofCanvasItem
orGeometryInstance3D
, so it should already be unique for each instantiated card. So without more information I'm not sure whyset_instance_shader_parameter
is not working.