Hi! I am completly new to coding, so I struggle a little bit. I want to make game where player can change object's color. I watched tutorials but I still can't replicate the effect in any way. I struggle a lot with coding so I thought maybe there is a way to acces a color picker node inside a shader graph? I know I have to use shaders anyway because there will be additional texture on my mesh that changes it's color through players input. I would like to ask for help on handling this, thank you in advance!
How to acces colorpicker node in shader graph?
Asked Answered
Peyton
Shaders run on the graphics card and generally have no access to scene tree nodes. So you can't connect a node like ColorPicker
into a shader network.
If you want player to change the color of an object, you need to write a script that gets the color from ColorPicker
and assigns it to albedo property in object's material.
Note that if you're trying to follow a 3.x tutorial in Godot 4.x it may not work because some of the functions changed between versions. So be sure to find a tutorial for version 4.
Frontage Thank you! I will try doing that ^^
© 2022 - 2024 — McMap. All rights reserved.