Need Help in Sending JSONOBJECT to Node Js

This code does not work

socket.Emit(“move”, new JSONObject(VectorToJson(position)));

It is sending the null object to the node server

can anyone help in sending JSONObject to the node server

Try breaking it up a bit.

public static void Move(Vector3 current, Vector3 destination)   
{   
	JSONObject jsonObject = new JSONObject(JSONObject.Type.OBJECT);   
	jsonObject.AddField("c", Network.VectorToJson(current));   
	jsonObject.AddField("d", Network.VectorToJson(destination));   
	socket.Emit("move", jsonObject);   
}   

public static JSONObject VectorToJson(Vector3 vector)
{
    JSONObject jsonObject = new JSONObject(JSONObject.Type.OBJECT);
    jsonObject.AddField("x", vector.x);
    jsonObject.AddField("y", vector.z);
    return jsonObject;
}