Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Exit

0

/t5/after-effects-discussions/math-sin-expression-problem-3/td-p/14882726
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

Hi,

I cant write expression. But I try to. I dnt know how can I write this, because what I wrote is not giving me my expected result.

I want the circle to stay beside the clock. and I linked the circle's Y position movement with the rotation of the clock hand. but the X axis of the circle is in weird position. how should I write the expression to keep the circle's X positon fixed or whereever I want it or just beside the clock but only Y should be take its value from the rotation of the clock hand.

Please guide me.

TOPICS

Expressions
,
How to

Community guidelines

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

Enthusiast
,
Sep 26, 2024
Sep 26, 2024

If you want the sun to be next to the clock, adjust the X position of the sun.

You can also adjust the amplitude.

11
Replies
11

/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882773#M256533
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

Your dimensions are separated, so you should return only a single value and not an array.

just return temp value

Community guidelines

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

Suraiya A
AUTHOR

Engaged
,

/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882791#M256534
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

I am very slow at picking clue, face palm, I dnt understand wht u said. what should I write?

temp = Math.sin(thisComp.layer("rotating hand").transform.rotation / 5) * 100;

[temp [value]];

this??

Community guidelines

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

/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882804#M256535
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

just return:

```
Math.sin(thisComp.layer("rotating hand").transform.rotation / 5) * 100;
```

Community guidelines

Suraiya A
AUTHOR

Engaged
,

/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882809#M256536
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

It doesnot work!!! I attached kindly check!! the circle goes some weird position if I write this!

Community guidelines

/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882863#M256538
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

Try this:

`Math.sin(degreesToRadians(thisComp.layer("rotating hand").transform.rotation - 90)) * 100 `

Community guidelines

Suraiya A
AUTHOR

Engaged
,

/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882884#M256539
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

Yours last expression makes the circle comes down a lil bit. In the meantime I googled and found another tutorial, and from there I picked the essence and this brings down the circle a lot--

x = thisComp.width/2;

y = Math.sin(thisComp.layer("hand").transform.rotation /10) * 400 + thisComp.height/2 + 50;

Community guidelines

Suraiya A
AUTHOR

Engaged
,

/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882886#M256540
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

but the x position of the circle is still fixed. cant move it freely.I wonder why its fixed.

Community guidelines

/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882915#M256541
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

The calculation depends on the animation you want to create with the expression I gave you.

When the "rotation hand" layer's angle is 0°, the "sun" layer is at the top, and when the angle is 180°, the "sun" layer is at the bottom.

Community guidelines

Suraiya A
AUTHOR

Engaged
,

/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882926#M256543
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

Community guidelines

/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882969#M256545
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

Community guidelines

Suraiya A
AUTHOR

Engaged
,

LATEST
/t5/after-effects-discussions/math-sin-expression-problem-3/m-p/14882990#M256546
Sep 26, 2024
Sep 26, 2024

Copy link to clipboard

Copied

Community guidelines

Resources

Troubleshooting FAQs

After Effects Community Recap

Getting started with After Effects

Copyright © 2024 Adobe. All rights reserved.