Control Null object position with slider and user defined value

New Here ,
Feb 06, 2022 Feb 06, 2022

Copy link to clipboard

Copied

IMG_2551.PNG

 

TOPICS
Error or problem , Expressions

Views

114

Likes

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

Adobe Community Professional , Feb 06, 2022 Feb 06, 2022
You are way overthinking the problem. If you simply add or subtract the value of the slider multiplied by your chosen offset to the property you want to move, you will have your solution. It looks like this: mov = effect("Slider Control")("Slider") * 100; [value[0] - mov, value[1]]

Likes

Translate

Translate
Adobe Community Professional ,
Feb 06, 2022 Feb 06, 2022

Copy link to clipboard

Copied

I think I'd need to see the expression you're actually using.  It's difficult to spot the issue from your diagram

 

Likes

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
New Here ,
Feb 06, 2022 Feb 06, 2022

Copy link to clipboard

Copied

Screenshot 2022-02-06 at 8.18.05 PM.png

 

Screenshot 2022-02-06 at 8.16.47 PM.png

Screenshot 2022-02-06 at 8.17.05 PM.png

Screenshot 2022-02-06 at 8.17.34 PM.png

Have a close look at the markers. The frames are moving more than the required distance

 

It is happening because I multiply the slider value with ( user defined value) i.e 489.

 

I want it to minus the same distance of (489px) or (user defined) each time when I increase the slider value.

Let's say slider is = 
1 then I want to minus 489px from [X-position of layer "frames"]

and same with other slider values 

 

slider value =

2  then  minus 489px from [X-position of layer "frames"]

15 then  minus 489px from [X-position of layer "frames"]   ---->  {MINUS SAME VALUE EACH TIME}

 

But it not happening cuz I multiplied it with 489

Right now I facing this issue

Slider value = 1 then  minus 489px from [X-position of layer "frames"]

Slider value = 2 then  minus [2*(489px)] from [X-position of layer "frames"]

Slider value = 4 then  minus [4*(489px)] from [X-position of layer "frames"]

Slider value = 15 then  minus [15*(489px)] from [X-position of layer "frames"]

 

IDK how to fix this issue

Likes

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
Adobe Community Professional ,
Feb 06, 2022 Feb 06, 2022

Copy link to clipboard

Copied

This is really hard to get my head around what you're trying to do, because it feels like it is really simple, but then that doesn't make sense.

You're creating a zoetrope-type look, where each frame will move along by 498 pixels times the slider value?  But the marker is drifting by a different amount each time.  But your original sketch suggests that each frame should only ever move 500 pixels ( guessing you rounded from 498 for simplicity) at all.  Which is where I get confused.

 

Looking at your expression, my best guess is that this is actually right for what you're wanting but the marker's Anchor Tag is not located at the tip of the point - as a result each multiplication is moving it slightly further off.  

 

Likes

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
New Here ,
Feb 06, 2022 Feb 06, 2022

Copy link to clipboard

Copied

yes 

I want to move it by 500px only each time slider value increses

Slider value = 1 Move "frames" layer by 500px

Slider value = 2 Move "frames" layer by 500px again and not by (1000px)

Slider value = 3 Move "frames" layer by 500px again and  not by (1500px)

and so on.

Likes

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
Adobe Community Professional ,
Feb 06, 2022 Feb 06, 2022

Copy link to clipboard

Copied

But "500 again" is the same as 1000 from its first position.

 

If you want to DM me and share a link to your project, I can take a look and see if I can spot anything.

Likes

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
Adobe Community Professional ,
Feb 06, 2022 Feb 06, 2022

Copy link to clipboard

Copied

You are way overthinking the problem. If you simply add or subtract the value of the slider multiplied by your chosen offset to the property you want to move, you will have your solution. It looks like this:

mov = effect("Slider Control")("Slider") * 100;
[value[0] - mov, value[1]]

RickGerard_0-1644168326610.png

 

Likes

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
New Here ,
Feb 06, 2022 Feb 06, 2022

Copy link to clipboard

Copied

First of all thankyou verymuch.
and waht if I want to do the same with Y-axis

Likes

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
Adobe Community Professional ,
Feb 06, 2022 Feb 06, 2022

Copy link to clipboard

Copied

LATEST

Just change the array.

mov = effect("Slider Control")("Slider") * 100;
[value[0}, value[1] + mov]

Likes

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