Hi edgepark,
The problem with this is certainly given that you like to change something, but at the same moment you like to work with the original data. Once the changes start, the calculation will be done for each frame or with each frame “refresh”. Think of a microphone feedback loop.
To avoid this, we need something to store the original data in, this can be Nulls, a complete (invisible) copy of the cube) ore just points of a mesh. Which brings my idea back to the original idea, which is simpler to do.
You didn’t use it, so lets move on. Another simple way would be done with polygons (single) and a Connect Object and then via MoGraph. Scale from the Effector origin. I skip this here as well, as you didn’t use the first one, XPresso is requested. OK. :o)
I assume that the moment is larger when the distance was initially larger, and smaller if closer. So a dynamically movement, right. If you add just the slider-value to it, then you would need the middle point.
Hence why I suggested the scale/null method. You haven’t answered the X only question, so I assume here as well, that X is the only direction you need.
The Original Right Cube stays on its position, otherwise to which of the cubes is it supposed to be reacting to. It can’t to the average of all, as they react to the cube, feedback loop again.
So the right cube stays, and the distance is scaled each time, no middle point needed.
Have a look to the file, and the slider on the “XP_controller Null”. 100% means here, they moved completely to the original right cube. Negative values means, they move away. Of course 0% they do not change at all. IF you move the “stored” cubes, you create a new start. You could even feed the Z and Y values, if you like to adjust the stored ones.
You will see that I added to the P.X value 100,000 before I went on to move the cubes. This is a step that prevents to mess with the +/- coordinates. As distance and added values to positive as well negative X values would lead to an unwanted result. If your cubes have the need to move beyond that dimension of 100K, adjust the values!
All the best
Sassi
P.S. file…01 had two adapters in it, which were obsolete already. …02 is fixed.