-
Expressions, wiggle and dimensions
Hi,
I’m currently learning expressions and trying to get my head around dimensions and expressions.
In the book i’m reading by Marcus Geduld, he tends to write expressions like this:
var bothDimensions = wiggle(1,200);
var widthDimension = transform.scale[0];
var heightDimension = bothDimensions[1];
[widthDimension, heightDimension]But I understand you can write the same expression like this:
transform.position[0], wiggle(1,200)[1]
Which for me is easier to grasp and use.
My question is when it comes to this:
[transform.position[1], wiggle(1,200)[1]]
I thought it meant that on the Y axis, you are saying to use both the keyframes AND add an wiggle, while the X axis, although you haven’t stated it in the expression, remains as transform.position[0]?
Although this doesn’t compute when it comes to trying that theory out. Any keyframes are cancelled out by the expression.
[wiggle(1,200)[0], transform.position[1]]
Results in the wiggle on the X axis as planned, but you cannot keyframe the Y axis. Fine. But what does this mean then?
[wiggle(1,200)[1], transform.position[1]]
Now it is still wiggling along the X axis but I though the X axis was 0?
I get even more confused when it comes to scale, that only has one dimension.
So what is the difference between:
[wiggle(1,200)[1], transform.scale[0]]
And
[wiggle(1,200)[1], transform.scale[1]]
?
I will get my head around it!
Olly Lawer