- Home /
All my variables are saying NaN. Am I overloading Unity? (solved)
For some reason, I had used Mathf.Lerp() 11 times and my script worked fine, but every time I try to add another, I get really strange results as if the function isn't working anymore.
I decided to copy and paste a section of my existing code with Mathf.Lerp()s and added new variables. I got a bunch of my old variables saying "NaN" and a whole bunch of overflow errors.
I could almost guarantee my code looks fine as my project did work when I hit play, but it would come to a complete stop with 0 fps. Why is this happening?
"NaN" means "Not a Number". $$anonymous$$aybe your scripts are perfor$$anonymous$$g some divisions by zero. Post a bit of your code, if this wouldn't help you.
Right.. NaN usually means infinity.
See what I ended up doing is rewriting my logic in order to avoid using the Lerp function as much.
Sorry for the bother.. I suppose I'll be solving this one on my own.
Your answer
Follow this Question
Related Questions
elastic scrolling scripting 0 Answers
BurgZerg Arcade inventory system tutorials... Incomplete!! 1 Answer
Player movement issue... 1 Answer
set limit mouse x y Help needed 1 Answer
suddenly have 'nan, nan, nan' error 2 Answers