Local Storage underscore properties _x _y _z


I just updated the Babylon js code on some activities built on older versions of Babylon js and I am working through the issues.

I found that my code was looking in Local Storage for the properties: position, scaling, rotation and cameras as just .x .y .z but they are now stored as ._x ._y. _z . I updated for this and it all seems to work.

Is it just in Local Storage that the x,y,z properties are given underscores? Seems like it


We moved from fields to properties sometimes ago for vectors so we can detect when a vector is dirty and thus update our internal cache

So internally now the class store a ._x field used by the .x property

Ok Thanks,
I had to update babylon js because of the new precision shader bug

So I can access for example “scaling.x” as a property but in the class internally it is “scaling._x”

I solved the - saving to local storage - by saving new objects that reference the underscore properties but the new objects in local storage have regular x y z properties without underscores. I had been saving the scaling object directly from babylon and this created an error.

Everything seems to work fine this way and is backwards compatible to data people may have saved on local storage

1 Like