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

Change starting position with drop down expression

Explorer ,
Mar 06, 2024 Mar 06, 2024

Copy link to clipboard

Copied

I have animated two lines of type for a template where they animate from opposite starting positions and then come together. The drop down in the template allows one line of type, two lines and a third option where both lines have the same starting position. 

I've tried using this expression all with no luck. 

dropMenu = effect("Dropdown Menu Control")("Menu");
myListe = [960, 960, -960];
myPlace = myListe[dropMenu - 1];
key1 = key(1).value[1];
key2 = key(2).value[1];
xVal = linear(value[1], key1, key2, key1, myPlace + key2);
[,xVal,value[0]];

 
Any help would be appreciated. Screenshot 2024-03-06 at 23.33.27.pngScreenshot 2024-03-06 at 23.33.51.pngScreenshot 2024-03-06 at 23.34.04.png

TOPICS
Expressions

Views

145

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

Engaged , Mar 07, 2024 Mar 07, 2024

try:

if(time >= key(1).time){

screenshot.png

 

Votes

Translate

Translate
LEGEND ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

The properties you appear to be applying the expression have no keyframes, so what is the linear function even supposed to be doing? And your final statement has an extraneous comma, which of course would throw everything off.

 

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
Explorer ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

@Mylenium It is the position property in the screenshot with those two keyframes. I removed the expression which I've written above. 

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
Engaged ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

 

If you have 4 items in your dropdown menu, you must have 4 entries in your array.

And the first 2 entries in the array are identical, there is likely an issue, or you can remove 1 item from the dropdown menu.

 

dropMenu = effect("Dropdown Menu Control")("Menu");
myListe = [960, 960, -960]; // Add a value here
myPlace = myListe[dropMenu - 1];

 

 

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 ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

@Airweb_AE 

Hi, I'm still stuck with this one. I found another bit of code which is changing the start point but as soon as I move one frame it jumps back to what it was previously. All I want to do is to have an expression that says on drop down 4 the X position should -960 so it enters from same direction as the line above. 

Screenshot 2024-03-07 at 16.49.34.pngScreenshot 2024-03-07 at 16.49.44.pngScreenshot 2024-03-07 at 16.50.00.png

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
Engaged ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

LATEST

try:

if(time >= key(1).time){

screenshot.png

 

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