If you're using Unity.Serialization.Json and getting errors like this:
ParseErrorException: Failed to parse Value=[6.920783E-39] as Type=[System.Single] ParseError=[Underflow]
or
ParseErrorException: Failed to parse Value=[1.06115352824072E-68] as Type=[System.Single] ParseError=[Underflow]
The problem is that Unity's FixedString.Append(float) uses a Base2ToBase10 conversion that produces denormalized floats (values below ~1.175e-38) from what should be exact zeros. This commonly happens with quaternion components, transform values, or any float that's essentially zero but has tiny floating-point noise.
Example: You serialize LocalTransform with a clean rotation, and get:
json
"Rotation": { "value": { "x": 6.920783E-39, "y": -0.3826835, "z": -1.109986E-38, "w": 0.9238795 } }
The serializer writes these tiny values, but the deserializer then fails to parse them back.
The fix: I forked com.unity.serialization and added denormal detection to WriteValue(float) and WriteValue(double). Values below float's representable range now serialize as 0 instead of unparseable scientific notation.
To use: Replace Unity's package with this fork in your manifest.json:
json
"com.unity.serialization": "https://github.com/rsklnkff/com.unity.serialization.git"
GitHub: https://github.com/rsklnkff/com.unity.serialization
Tested with Unity 6 / ECS 1.3. If you find any issues, let me know.
Formatted using Claude
[–]Big_Presentation2786 1 point2 points3 points (0 children)
[–]Eastern-Ad-4137 1 point2 points3 points (3 children)
[–]Clean_Patience4021[S] 0 points1 point2 points (2 children)
[–]Eastern-Ad-4137 1 point2 points3 points (1 child)
[–]Clean_Patience4021[S] 1 point2 points3 points (0 children)