Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Expression error - Ignore parent scale

Community Beginner ,
Mar 08, 2023 Mar 08, 2023

I'm following this tutorial https://www.youtube.com/watch?v=Qupphl-scQY and the first time I got an error message for the first part of the expression. In project settings I switched from JavaScript to Legacy ExtendScript, restarted AE and tried again: the first error solved itself but a new error appeared instead. The orange object is the parent and a 3D object if it matters. Any thoughts on how I could solve this? 

s = [];
parentScale = parent.transform.scale.value;
for (i = 0; i < parentScale.length; i++){
s[i] = (parentScale[i]== 0) ? 0 : value[i]*100/parentScale[i];
}
s

Screenshot 2023-03-07 232413.pngScreenshot 2023-03-08 122533.png

TOPICS
Error or problem , Expressions , Scripting
746
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 08, 2023 Mar 08, 2023

Your parent layer is a 3D layer and thus has three scale values whereas your ball is 2D. Thus the code looks for a value that doesn't exist. Tunr on 3D or modify the expression to be parentScale.length-1.

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 15, 2023 Mar 15, 2023
LATEST

Ohh makes sense! Thank you!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines