Skip to main content
MARIANCE
Known Participant
March 5, 2021
Answered

Error: Couldn't turn result into numeric value

  • March 5, 2021
  • 1 reply
  • 5873 views

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

 

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.

This topic has been closed for replies.
Correct answer OussK

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]

 

 

1 reply

OussK
Community Expert
OussKCommunity ExpertCorrect answer
Community Expert
March 5, 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]

 

 

MARIANCE
MARIANCEAuthor
Known Participant
March 5, 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
OussK
Community Expert
Community Expert
March 5, 2021

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