Clamp expression on a moving object
Hi, I've been searching and Googling around and still haven't gotten a clear answer as to whether or not the following setup is possible.
You have two layers, Layer A and Layer B next to eachother. The goal is to animate both of their positions, but make it so that Layer A's x position is limited to Layer B's position, even though they're both moving (Layer A would stop and be clamped to Layer B's X position when it runs into it). My understanding of the clamp expression is that you should do the following:
Put a clamp expression on Layer A's position
Clamp is an array (value, min, max)
Depending on whether Layer A or Layer B was on the left or right of eachother, you would highlight the min or max value in the clamp expression and pickwhip it to the x value of Layer B.
..And this would effectively make it so that if both Layers were next to eachother and moving in circle simultaneously, and those motion paths overlapped, Layer A would run into Layer B and be clamped to its moving X position until their motion paths didn't overlap anymore.
I think I may be missing some fundamental understanding of how the clamp expression works, and how you differentiate between clamping X and Y axes individually and clamping the entire position.. just surprisingly haven't found any documentation that clarifies this. Any help is much appreciated.
