+1 vote

So when i change the modulate of a tilemap through the editor it keeps the relative shades of the colors. So previously white is just as bright and the previously dark greys are just as dark. but when i change the modulate through script it all changes to the same color.

Godot version stable 3.5.1
in Engine by (49 points)

This works correctly for me. What code are you using to change the modulate?

Just a really simple "get_node("TileMap").modulate = Color(x, y, z)" (not exactly this but the modulate changing method is the same)

I use Color(String) because it's easier to copy-paste from color pickers, but if you use the Color(r, g, b) then make sure that the values are fractions, not 8-bit integers (i.e, 0.6 instead of 153). There's also a button in the color picker that looks like a hashtag that you can click and it'll give you a copy-paste of the values you need.

Thank you so much. That was the problem. I had the values set from 0-255 instead of floats between 0.1. Changed them to hexadecimal strings instead and now it works!

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.