ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Multiply Position; "Must be a scalar"

FAQ   •   VIEW ALL
 Multiply Position; "Must be a scalar" on Mar 2, 2019 at 5:44:14 pm

...whatever that means..!
Why won't
transform.position * [0, -1];
not work?

I'd have to do something like this to make that work..
a = transform.position;
[a[0], a[1]*-1]

Is there no other way?

Figure I'd get that cleared up after years of confusion...!

http://www.ardillamedia.com

 Re: Multiply Position; "Must be a scalar"on Mar 3, 2019 at 3:44:47 am

Well, cause one of the arguments of * operation 'must be a scalar'. Smth like that would work in Python but not in Javascript.

[a[0], a[1]]*[1, -1] = [a[0], a[1]*(-1)] is element-wise multiplication. It exists in JS's as math.dotMultiply(x, y) but is not implemented in AE's expressions.

 Re: Multiply Position; "Must be a scalar"on Mar 4, 2019 at 12:05:49 pm

ooohkay.. I googled "javascript scalar" (..and later "element-wise multiplication").
"A Scalar is a variable that holds an individual value."

That cleared that up!
Thanks!

http://www.ardillamedia.com