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

Error: Couldn't turn result into numeric value

Explorer ,
Mar 05, 2021 Mar 05, 2021

Hi, I'm using a simple expression and I'm getting this error.

error.jpg

 

This is the code:

var x = value[0];
var a = thisComp.height/2;
var f = .5;
var y = Math.sin(time*2*Math.Pi*f)*a;

[x,y]

 

I watched a YouTube tutorial that used this same code (without using var) and it seemed to work, but not to me.

MARIANCE
TOPICS
Error or problem , Expressions
5.8K
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

correct answers 1 Correct answer

Community Expert , Mar 05, 2021 Mar 05, 2021

you should right PI instead of Pi so try this:

 

var x = value[0];

var a = thisComp.height/2;

var f = .5;

var y = Math.sin(time*2*Math.PI*f)*a;

[x,y]

 

 

Translate
Community Expert ,
Mar 05, 2021 Mar 05, 2021

you should right PI instead of Pi so try this:

 

var x = value[0];

var a = thisComp.height/2;

var f = .5;

var y = Math.sin(time*2*Math.PI*f)*a;

[x,y]

 

 

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
Explorer ,
Mar 05, 2021 Mar 05, 2021

Thanks, it worked!

Why did it say it was error in line 1 and maked x instead telling me I misspelled PI? Weird...

MARIANCE
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 Expert ,
Mar 05, 2021 Mar 05, 2021
LATEST

Yes, the error system in AE still not smart enough to fix the error 

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