Answers.Body: <p>The position of any point on a layer in terms of its location in the composition frame is given by the layer space transform function <code>toComp()</code>. Since the top left of a layer is the origin in After Effects, from the point of view of the solid its top left is going to be [0, 0]. So we find the position of the point [0, 0] on the layer in terms of the comp thus:</p>
  
  <pre><code>thisComp.layer('&lt;name of the solid&gt;').toComp([0,0])
  </code></pre>
  
  <p>Apply that to the position property of the layer you want to stick to the solid.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-18T05:24:49.063Z
Answers.LastActivityDate: 2018-06-18T05:24:49.063Z
Answers.UserDisplayName: stib
Body: <p>I was wondering about a expression that sticks a layer position on to the top left corner of a square solid in After Effects, so that when the scale of the solid changes, the stuck position follows the corner around. Can someone help with this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-18T05:13:53.970Z
Comments.Text: Is there a reason you want an expression, rather than using parenting?
Comments.UserDisplayName: stib
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-19T18:54:22.423Z
Comments.Text: yes there is. I need the object move along with the corner of the other. The object master will scale up and down with the expression sourceRecAtTime and the object child will need  stick on its left corner.
Comments.UserDisplayName: Ronie Silva
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-19T18:55:04.067Z
Comments.Text: only position not scale.
Comments.UserDisplayName: Ronie Silva
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-19T23:37:35.560Z
Comments.Text: Ok, my answer should work for you.
Comments.UserDisplayName: stib
Tags: <video>
Title: Stick a layer position on another top left corner of a square layer in After Effects
UserDisplayName: Ronie Silva
ThreadText: # Stick a layer position on another top left corner of a square layer in After Effects
  
  (Asked by: username_0 on 2018-06-15)
  
  I was wondering about a expression that sticks a layer position on to the top left corner of a square solid in After Effects, so that when the scale of the solid changes, the stuck position follows the corner around. Can someone help with this?
  
  **Tags:** video
  
  > **Comments:**
  > **username_1**: Is there a reason you want an expression, rather than using parenting?  
  > **username_0**: yes there is. I need the object move along with the corner of the other. The object master will scale up and down with the expression sourceRecAtTime and the object child will need  stick on its left corner.  
  > **username_0**: only position not scale.  
  > **username_1**: Ok, my answer should work for you.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-06-18. Score: 1
  
  The position of any point on a layer in terms of its location in the composition frame is given by the layer space transform function `toComp()`. Since the top left of a layer is the origin in After Effects, from the point of view of the solid its top left is going to be [0, 0]. So we find the position of the point [0, 0] on the layer in terms of the comp thus:
  
  ```
  thisComp.layer('<name of the solid>').toComp([0,0])
  
  ```
  
  Apply that to the position property of the layer you want to stick to the solid.
  
  
  ---
  
  