Skip to main content
Participating Frequently
November 8, 2022
Question

why is typeof "transform.position" a function and not an array?

  • November 8, 2022
  • 1 reply
  • 359 views

I created a nullLayer and then a textLayer. Inside the expression for textLayer I put the following:

var a = thisComp.layer("nullLayer").transform.position
typeof a

 

And the text box for the textLayer shows "function". I would expect the "transform.position" to return an array of two coordinates. How would I accomplish that? What I am trying to achieve is to get a[0] and a[1] separately. Maybe this is just me overseeing some minor thing, all help appreciated.

There is no expression on the position of nullLayer.

 

 

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
November 8, 2022

You can treat it like an array. This should work:

a = thisComp.layer("nullLayer").transform.position;
a[0]