FORUMS: list search recent posts

Scale change by position

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
assaf tshuva
Scale change by position
on Jun 5, 2017 at 10:31:00 am

Hello,

I'm animating a character for an "arcade game" video. I'm looking for a way to make the character turn left when I move it to the left and vice versa (scale X = 100 or -100, not rotation), depending on the change in the position.
I tried using speed value, but it's an absolute value.
Couldn't find if something similar was answered.

Thanks.


Return to posts index

Cassius Marques
Re: Scale change by position
on Jun 5, 2017 at 1:41:24 pm

how about having another copy as a hidden reference with a very low negative time offset expression linked to main's the position? essentially creating a ghost of the character.

Then set an expression on scale with a < > condition using the X axis as reference.

Cassius Marques
http://www.zapfilmes.com


Return to posts index

Cassius Marques
Re: Scale change by position
on Jun 5, 2017 at 1:55:45 pm

Well, thinking about it you can skip the another layer part:

Just go for a = transform.position[0]
b = position.valueAtTime(time-0.1)[0];
(a <b?[-100,100]:value);

in the scale

Cassius Marques
http://www.zapfilmes.com


Return to posts index


assaf tshuva
Re: Scale change by position
on Jun 7, 2017 at 6:05:22 am

Hey,
It's works almost perfectly, thank you.
The only problem now, is that when the character stops for a moment, it "resets" its direction - if the scaleX was -100, on halting it goes back to 100 instead of waiting for a change.

And can you please explain the third line? Didn't understand the structure... (the question mark and ":value")
(a
thanks


Return to posts index

Cassius Marques
Re: Scale change by position
on Jun 7, 2017 at 12:22:43 pm

[assaf tshuva] "The only problem now, is that when the character stops for a moment, it "resets" its direction - if the scaleX was -100, on halting it goes back to 100 instead of waiting for a change."

yes I know, expressions can't see past frames. The best you can do is set an imperceptible value diference in X so it stays -100 (it will look still for the animation but for the program its moving). I'm sure someone with more knowledge about the language can come up with something that works smoothly. I cannot.

[assaf tshuva] "And can you please explain the third line?"

Thats one way to create an if/else statement.

(condition met ? "yes, do this" : "no, do that")

Cassius Marques
http://www.zapfilmes.com


Return to posts index

assaf tshuva
Re: Scale change by position
on Jun 7, 2017 at 12:47:43 pm

Got it, thanks for trying.
And thank you for the new syntax (for me)


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]