Is it better to call "this" or "that" on a Value?

Is it better to call .Changed or :GetPropertyChangedSignal() on a Value? I know that .Changed is firing every time some property changes, but that won’t be a problem since I am not updating the Parent or Name properties. So? Which one is better?

ValueBase objects have modified .Changed event that only fire when Value property changes. So there would be no difference between .Changed and :GetPropertyChangedSignal("Value").

1 Like

Are you sure of that? 3 properties can be modified through a script, so I won’t see why they would do that?

Yes:

1 Like

He is correct. I just ran a test on my own.
Thanks for the new knowledge @BenMactavsin

Interesting enough for me… Anyway, GetPropertyChangedSignal() seems like the best I can do?

I’d use :GetPropertyChangedSignal(), personally. I like the look of it, and if you’re looking to check if a single property changes then you should too.

1 Like

It honestly comes down to preference when detecting Value property value changes on ValueBase objects. In most of other cases that you would need to listen to a single property, you should use :GetPropertChangedSignal(Property) instead*.

*Note: If the property you’re listening to doesn’t fire PropertyChanged events because of reasons like physics being able to modify the property every PostSimulation or ect., you will have to use RenderStepped/PreRender or PostSimulation/Heartbeat events depending on the use case.

1 Like