-
plane propeller rotation (newbie question)
This will be embarrassingly simple for you expression wizards, but I’m new to expressions, so even the basics are tying my brain in knots. I searched the forums, but all the rotation questions I came across are much more involved than what I’m attempting to do.
I have a propeller (in 3D space) whose rate of rotation is linked to a slider in another comp. I want it to spin nice and fast, then slow and come to a stop. Very simple.
So the expression on the propeller is:
spinControl = comp(“Flying Plane”).layer(“Prop Spin Control”).effect(“Prop Spinner”)(“Slider”);
time * spinControl;The slider starts at 2000, which seems to be nice and fast (but why does this have to be such a high number? shouldn’t 360 be one complete rotation?), then at a certain point it starts down until it gets to 0. The problem occurs when it starts the decline… instead of just slowing down, it reverses direction, THEN slows to a stop.
Shouldn’t time multiplied by a positive number always produce a clockwise rotation?
Then I swapped out the second line of code for this:
transform.zRotation.valueAtTime(time + spinControl);My thought was that it would take the value of the z rotation at that time and add the amount of the slider to it, then in the next frame do the same, and so on. But it just puts the propellor at a specific unmoving angle, so clearly I’m also not understanding the valueAtTime function, either.
I know I’m going about this wrong, but I’m not sure where the problem lies, so any help would be appreciated.