[SOLVED] GUI / Can't color a cloned node in grayscale

Hi!

Until very recently, my level buttons were created directly in the editor and colored using this method:

Now that they are dynamically created (= cloned), the colorization doesn’t seem to work anymore (while the method remains the same).

image
(in this case, I want to grey the locked levels)

-- source node => works
		gui.animate(gui.get_node("btn_level/button"), "position.z", grey_level, gui.EASING_LINEAR, 0.1, 0, function() end, gui.PLAYBACK_LOOP_FORWARD)

		-- cloned nodes (both are the same, manual/dynamic) => none of them work
		gui.animate(gui.get_node("btn_level_4/button"), "position.z", grey_level, gui.EASING_LINEAR, 0.1, 0, function() end, gui.PLAYBACK_LOOP_FORWARD)
		gui.animate(node, "position.z", grey_level, gui.EASING_LINEAR, 0.1, 0, function() end, gui.PLAYBACK_LOOP_FORWARD)
	end

Is this a known issue? If so, is there a way to fix it?

Or another method to color a (cloned) GUI node in grayscale?

edit: worst-case scenario, I can still have a “greyed” animation for the node(s) in question (if I can’t grey the node at runtime)

Hmm, there’s nothing special with a cloned node. Can you somehow verify the z value of the cloned node? Perhaps print it in update ()?

1 Like

Yeah, in the meantime I realized that it was 100% my fault (something was wrong with the z value indeed, because of a really “sneaky” mistake in my code)

Thanks!

1 Like