How to acces colorpicker node in shader graph?
Asked Answered
P

2

0

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!

Peyton answered 10/9, 2023 at 12:5 Comment(0)
F
0

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 answered 10/9, 2023 at 16:49 Comment(0)
P
0

Frontage Thank you! I will try doing that ^^

Peyton answered 11/9, 2023 at 15:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.