Godot Version
4.7.stable
Question
Hi, it’s me again, I have this very specific bug(?) or behavior happening where I need it to not happen.
It’s easier to illustrate with a video:
As you can see, whenever I go to drag the Vector2’s components, the engine goes a couple decimal points and does nothing, even though I’m still holding LMB. Is this intentional?
The value does have a setter, which I tested without, and it works like normal when the setter is removed:
@export_group("Points Array")
@export var points_array : Array[Vector2] = [Vector2.ZERO, Vector2.RIGHT]:
set(value):
points_array = value
recalculate_aux()
notify_property_list_changed()
What is a “Vector2’s component”?
And I honestly don’t know what you’re trying to do on the video. As far as I can tell the engine is just trying to set a value as you drag across one of the fields, since you can hold down left mouse button and move it left and right to increase or decrease a value in a field.
A component is its X or Y values.
And no, I can’t drag it, I’m holding down LMB while I move my mouse, and it changes by a couple decimal points only, not even 0.1.
The entire time I’m moving the mouse horizontally, LMB is held down, and the value never changes after what seems to be the first frame.
Don’t call notify_property_list_changed() from the setter.
I’ll go back to work in like 10 hours and I can make a minimal example project then, mine just won’t work (maybe it’s because it’s also updating another variable in the same script, based on the vector array)
Funny, because I removed that and it still didn’t work, but I’ll return tomorrow with more troubleshooting.
Remove it and reload the scene. It should work then.
Also check that recalculate_aux() doesn’t call some other setter that still calls notify_property_list_changed()
Okay, yeah, tested on my phone, and it works now.
My mistake was thinking that my gizmo needed to be notified that the value was changing through the notification, when it does not.
Thank, mate, you’ve helped a lot.
notify_property_list_changed() completely rebuilds all of the controls in the inspector so the one you were dragging is destroyed and replaced with a fresh one that doesn’t have the dragging signals connected.