automatically setting floats in the editor when another float changes?

Hello!

I have a number of floats shown in the inspector which are clamped between 0 and 1. The sum of all these floats should be 1. So when a user adjusts one float, the remaining floats should be adjusted to maintain the sum of 1.

How should I go about adjusting all the values as a player changes them? Via editor scripting I assume?

Thanks!

You can use the OnValidate event to trigger this. This would be easiest if all of these floats are in the same MonoBehaviour.

@kdgalla Ok, I was hoping I could just monitor the change of a single value because it becomes easier to manage that way. Thanks anyway!