why extends Resource, 2 export var with the same value is linked? is it intended or is it bugged?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By pqr
class_name Player
extends Resource

export var eye_color = [0, 0.5, 0.5] # HSV
export var hair_color = [0, 0.5, 0.5] # HSV

func ec_hue_change(value): # connect with a hslider maxvalue 360 step 360
    print(eye_color, hair_color) #[0, 0.5, 0.5][0, 0.5, 0.5]
    eye_color[0] = value # slide to 360
    print(eye_color, hair_color) #[360, 0.5, 0.5][360, 0.5, 0.5]
    emit_changed()

func hc_hue_change(value): # connect with another hslider maxvalue 360 step 360
    hair_color[0] = value
    emit_changed()
    # sliding this hslider doesn't print anything but both var is changed

^^^ why is this happening?
I tried change export var eye_color to [0.0, 0.5, 0.5] (eye_color[0] is now a float)
and it’s work why is that?

Use Color.from_hsv(0, 0.5, 0.5, 1) instead of lists.

(and format code in your questions properly (there is a button for it))

USBashka | 2022-08-04 13:08

:bust_in_silhouette: Reply From: jgodfrey

This is a know issue. Here’s one thread with some info and work-arounds, and some links to additional info.

https://www.reddit.com/r/godot/comments/oecg6u/weird_bug_with_arrays/