Skip to main content
Participant
June 20, 2023
Answered

Arrow head rotation flipping

  • June 20, 2023
  • 2 replies
  • 863 views

Hey guys, I'm having an issue where I keyframe the path of the line and the linked arrow head flips back and forth. Hoping someone can help me solve this issue! I've isolated the issue to the rotation of the null that is following on the poition from the line's position, the arrow head is then linked to this null. 

Please see the expression on the null's rotation below and video of what's happening:

var pathToTrace = thisComp.layer("Shape Layer 1")("ADBE Root Vectors Group")(1)("ADBE Vectors Group")(1)("ADBE Vector Shape"); 
var progress = thisLayer.effect("Pseudo/ADBE Trace Path")("Pseudo/ADBE Trace Path-0001")/100; 
var pathTan = pathToTrace.tangentOnPath(progress); 
radiansToDegrees(Math.atan2(pathTan[1],pathTan[0]));

 

This topic has been closed for replies.
Correct answer Dan Ebberts

What is the value for progress? If it's at 0 or 100, I'm guessing the tangent may get a little dicey and you might want to pull it back slightly from the extreme (99.9 or 0.1 maybe -- just a guess).

2 replies

Community Expert
June 20, 2023

If you are linking an arrowhead to a null that is moving on a path, the easiest solution is to go to the last path keyframe, right-click, and choose Keyframe Interpolation/Spatial Interpolation/Linear as the option. Then select the null and press Alt/Option + Ctrl/Cmnd + O and choose Auto Orient. The last step is to Shift + Parent the Arrowhead Layer to the Null and fine-tune the Rotation property to line up the Arrowhead with the path. This always works, and there are no expressions involved. 

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
June 20, 2023

What is the value for progress? If it's at 0 or 100, I'm guessing the tangent may get a little dicey and you might want to pull it back slightly from the extreme (99.9 or 0.1 maybe -- just a guess).

Participant
June 20, 2023

This worked! That's so strange, never would've picked it. Thank you!