How do I check if objects values have been modified? (e.g. position, mass, starting velocity)

I have an editor script that calculates the future position of other objects and displays it as handles in the scene view. To be performant, I save the future positions in an array and then draw the lines from the array. The one drawback is that it doesn’t automatically update when an object has been modified (i.e. position or initial velocity) in the editor. I have searched online but couldn’t seem to find anything that worked.

I changed the editor script to a normal monobehavior script and used linerenderer and debug lines to draw instead. To detect changes, I use OnValidate() in the scripts I am checking for change and call a method which recalculates the lines. It works though I am still open to better ways of doing it.