• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Clamp expression on a moving object

Explorer ,
Jan 31, 2018 Jan 31, 2018

Copy link to clipboard

Copied

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.

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 01, 2018 Feb 01, 2018

I think I may be missing some fundamental understanding of how the clamp expression works

Yes, you have. You cannot just pickwhip a single internal value of the expression. An expression always modifies the entire property stream value and that can be either the min or max in this case. So unless your value range encompasses the full diameter of the circle and realyl only clips on one side, both values could occur. that being the case, you also could not move the circles around and dynamically sh

...

Votes

Translate

Translate
LEGEND ,
Feb 01, 2018 Feb 01, 2018

Copy link to clipboard

Copied

I think I may be missing some fundamental understanding of how the clamp expression works

Yes, you have. You cannot just pickwhip a single internal value of the expression. An expression always modifies the entire property stream value and that can be either the min or max in this case. So unless your value range encompasses the full diameter of the circle and realyl only clips on one side, both values could occur. that being the case, you also could not move the circles around and dynamically shift positions because then obviously you change the conditions and run into the same issue. If you realyl wanted that, you'd have to create a much more convoluted expression based on vector math testing proximity and intersections, a.k.a. collision detection.

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 01, 2018 Feb 01, 2018

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 11, 2018 Feb 11, 2018

Copy link to clipboard

Copied

LATEST

Gotta piggy back on this one.. can you somehow clamp an object on a path or curve? For example have a skier sliding and bouncing down the sode of a mountain.. the slope/side of the mountain would be the path that the skier is clamped to

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines