Question by
Goodgamejuli · Apr 24 at 06:32 PM ·
serializationsave dataroundroundingrounding-errors
How to serialize/save a vector3 without all decimals?
First of all I alredy preroundet the decimals to 3 decimals but here is the problem when I serialize the preroundet floats as Vector3:
{"TrackingList":[{"p":{"x":-0.1599999964237213,"y":-5.28000020980835,"z":0.05000000074505806}...
I want to have 3 decimals, can anyone help me?
Comment
Answer by ExoticPiney · May 03 at 11:31 PM
Tell me if this works:
public float[] name_of_vector;
name_of_vector = new float[3];
public function_name (object_reference object){
name_of_vector[0] = object.transform.x;
name_of_vector[1] = object.transform.y;
name_of_vector[2] = object.transform.z;
}