-
-
Notifications
You must be signed in to change notification settings - Fork 156
Closed
Labels
Description
The following expression is supposed to make rect2 rotate to face rect1 while it’s moving. It works correctly in lottie-web, but it’s not working in thorvg.
"slots": {
"rect2_rotate": {
"p": {
"a": 0,
"x": "var $bm_rt;\nvar rect1 = thisComp.layer('Rectangle 1');\nvar rect2 = thisComp.layer('Rectangle 2');\nvar rect1Pos = rect1.transform.position.value;\nvar rect2Pos = rect2.transform.position.value;\nvar dx = rect1Pos[0] - rect2Pos[0];\nvar dy = rect1Pos[1] - rect2Pos[1];\n$bm_rt = Math.atan2(dy, dx) * 180 / Math.PI;"
}
}
}
I’ve attached the Lottie file for your reference.
Screen.Recording.2025-08-06.at.6.16.15.PM.mov
tinyjin and hermet
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done 1.0