Newbie Colorpicker assign error

Godot Version

4.6.1

Question

Hey there! Super new to coding game. Coded a lot of html and CSS in school though. I followed a tutorial to make a color picker character editor and got it to work, but I am using that model to make what I actually want to now which is more complicated.

I am getting an error that says “main.@implicit_ready: trying to assign value of type ‘color picker’ to a variable of type bodytonebutton.gd. A file name doesn’t exactly sound like a variable type to me, but the

The node layout on the button scene is bodycontrolpanel→bodytonebutton→VBoxContainer→ColorPicker
Control→button→VBoxContainer→ColorPicker

the code is

class_name bodytone panel extends Control

signal changed (color: Color)
@onready var _color_picker: ColorPicker = $bodytonebutton/VBoxContainer/ColorPicker

func _ready() → void:
_color_picker.color_changed.connect(_on_color_changed)

func _on_color_changed(color: Color ) → void:
changed.emit(color)

pass

Thx in advance

Please format your code by pressing Ctrl+E or using the preformatted text button in the toolbar.

It sounds like you use a kind of custom class (bodytonebutton)as your body color picker, and when you try to save it as a ColorPicker variable in the line with @export, it says no as the class of the button is different.

Try to remove the type from the export variable or change it to bodytonebutton.