Answers.Body: <p>You could do it the nerdy mathematical way by finding the radius of the circle r, then using trigonometry to target a point on the line between the two centers—the center of the start null and the centre of the circle—that is r pixels back from the centre of the circle. You do that by finding the vector of the line between the two layers, then finding the angle that line makes, and multiplying the original vector, minus the radius by the cosine and sin of the angle to come up with the vector from the original null to the edge of the circle.</p>
  
  <p>This expression would do that (probably, I haven't tested it):</p>
  
  <pre><code>var r = &lt;the radius of the circle&gt;;
  var overallVector = thisComp.layer("circle layer").transform.position - thisComp.layer("start null").transform.position;
  var beamAngle = Math.atan2(overallVector[1], overallVector[0]);
  thisComp.layer("start null").transform.position + [Math.cos(beamAngle)*(length(overallVector) - r), Math.sin(beamAngle)*(length(overallVector) - r)];
  </code></pre>
  
  <p><strong>Or you could do it the quick and easy way</strong>, by making a circle solid the same size as the target circle, parenting it to the circle so that it is lined up with it, putting it directly above the beam layer, and then turning on alpha inverted track matte for the beam layer. That would make the beam invisible inside the circle. Boom!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-20T03:09:21.877Z
Answers.LastActivityDate: 2019-03-20T03:09:21.877Z
Answers.UserDisplayName: stib
Body: <p>I'm a total newbie to After Effects, and I've been trying to follow this tutorial to create an animated callout: <a href="https://www.youtube.com/watch?v=2BcbtVKt69U" rel="nofollow noreferrer">Youtube Advanced Callout</a></p>
  
  <p>The relevant bit is about 9:00 - 11:30 in the video...</p>
  
  <p>I've got it working nicely (though not as good as his!) except that I would like the right hand tip of the first animated beam ('Path 1' in his tutorial) to target the EDGE of the outer circle ('Shape Layer 1' in his tutorial) rather than the centre, so that it appears out of the stroke rather than the middle...</p>
  
  <p>I've tried to move the position relative to the null object but every time I link its position to the null object with the pick whip it snaps to the centre of the null object, meaning that the beam still ends up starting in the middle of the circle...</p>
  
  <p>I tried moving the handle for null object 1, but that just means the centre of the circle and the beam then both target that handle and the problem remains...</p>
  
  <p>If I move the handle for the circle then it screws the circle animation, because it then appears from the edge...</p>
  
  <p>Any suggestions for how I could make the first beem target the edge (the stroke) of the circle rather than the centre would be greatly appreciated... I'm a complete n00b to AE so please speak slowly and imagine you're explaining it to a very dopey Golden Retriever... ;-)</p>
  
  <p>Thanks!</p>
  
Tags: <after-effects><animation>
Title: target edge of null object rather than centre
UserDisplayName: The All Powerful
ThreadText: # target edge of null object rather than centre
  
  (Asked by: username_0 on 2019-03-15)
  
  I'm a total newbie to After Effects, and I've been trying to follow this tutorial to create an animated callout: [Youtube Advanced Callout](https://www.youtube.com/watch?v=2BcbtVKt69U)
  
  The relevant bit is about 9:00 - 11:30 in the video...
  
  I've got it working nicely (though not as good as his!) except that I would like the right hand tip of the first animated beam ('Path 1' in his tutorial) to target the EDGE of the outer circle ('Shape Layer 1' in his tutorial) rather than the centre, so that it appears out of the stroke rather than the middle...
  
  I've tried to move the position relative to the null object but every time I link its position to the null object with the pick whip it snaps to the centre of the null object, meaning that the beam still ends up starting in the middle of the circle...
  
  I tried moving the handle for null object 1, but that just means the centre of the circle and the beam then both target that handle and the problem remains...
  
  If I move the handle for the circle then it screws the circle animation, because it then appears from the edge...
  
  Any suggestions for how I could make the first beem target the edge (the stroke) of the circle rather than the centre would be greatly appreciated... I'm a complete n00b to AE so please speak slowly and imagine you're explaining it to a very dopey Golden Retriever... ;-)
  
  Thanks!
  
  **Tags:** after-effects, animation
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-03-20. Score: 0
  
  You could do it the nerdy mathematical way by finding the radius of the circle r, then using trigonometry to target a point on the line between the two centers—the center of the start null and the centre of the circle—that is r pixels back from the centre of the circle. You do that by finding the vector of the line between the two layers, then finding the angle that line makes, and multiplying the original vector, minus the radius by the cosine and sin of the angle to come up with the vector from the original null to the edge of the circle.
  
  This expression would do that (probably, I haven't tested it):
  
  ```
  var r = <the radius of the circle>;
  var overallVector = thisComp.layer("circle layer").transform.position - thisComp.layer("start null").transform.position;
  var beamAngle = Math.atan2(overallVector[1], overallVector[0]);
  thisComp.layer("start null").transform.position + [Math.cos(beamAngle)*(length(overallVector) - r), Math.sin(beamAngle)*(length(overallVector) - r)];
  
  ```
  
  **Or you could do it the quick and easy way**, by making a circle solid the same size as the target circle, parenting it to the circle so that it is lined up with it, putting it directly above the beam layer, and then turning on alpha inverted track matte for the beam layer. That would make the beam invisible inside the circle. Boom!
  
  
  ---
  
  