Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hi, 

I'm using Unity 2020.3.14f1 and when I import a demo and make a script like:  new BVH("D:\\Databases\\CMU\\BVH\\01\\01_08.bvh", -10).makeDebugSkeleton(true, "00ff00")

I get an error:

"

FormatException: Input string was not in a correct format.

System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) (at <695d1cc93cca45069c528c15c9fdd749>:0)
....
"

It's not related to the path, it's sth with parsing the actuall bvh. Can you help?


Marcin

Sounds something like ParseSingle() expecting numbers to use comma instead of period as the decimal point. Try specifically setting C#'s culture info to en-US before doing the BVH calls. ParseSingle() should then recognize the format as being correct.

System.Globalization.CultureInfo timeCultureUS = new System.Globalization.CultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = timeCultureUS;
Thread.CurrentThread.CurrentUICulture = timeCultureUS;
//BVH related things here