- Home /
using json file for waypoints for vehicle in unity project.
I'm learning from a project in which manager for vehicle waypoints spawning in using .byte (text file) file for spawning waypoints in game. which is initially made from a json file which is also available is project. The issue is i cant understand $ref. Can someone tell me how can i make a new waypoint file just like this one. {"$content":[{ "Point": { "x": -868.3, "y": -5.800003, "z": -695.1 }, "RoadLinks": [ { "Link": { "Point": { "x": -859.9523, "y": -8.426735, "z": -717.9402 }, "RoadLinks": [ { "Link": { "$ref": "0" }, "SpacerLineWidth": 0.0 }, { "Link": { "Point": { "x": -841.3722, "y": -5.483482, "z": -700.2738 }, "RoadLinks": [ { "Link": { "$ref": "2" }, "SpacerLineWidth": 0.0 }, { "Link": { "Point": { "x": -858.9, "y": -5.335197, "z": -675.2 }, "RoadLinks": [ { "Link": { "$ref": "5" }, }, { "Link": { "Point": { "x": -150.9, "y": 1.709984, "z": -730.1 }, "RoadLinks": [ { "Link": { "$ref": "339" },
},
{
"$ref": "650"
},
{
"$ref": "653"
},
{
"$ref": "655"
},
{
"$ref": "657"
},
{
"$ref": "659"
},
{
"$ref": "661"
},
{
"$ref": "663"
},
{
"$ref": "668"
},
{
"$ref": "670"
},
{
"$ref": "672"
},
{
"$ref": "674"
},
{
"$ref": "687"
},
{
"$ref": "690"
},
{
"$ref": "693"
},
{
"$ref": "696"
},
{
"$ref": "699"
},
{
"$ref": "702"
},
{
"$ref": "711"
},
{
"$ref": "722"
},
{
"$ref": "726"
},
{
"$ref": "742"
},
{
"$ref": "744"
},
{
"$ref": "749"
},
{
"$ref": "752"
},
{
"$ref": "755"
},
{
"$ref": "757"
},
{
"$ref": "759"
},
{
"$ref": "763"
},
{
"$ref": "765"
},
{
"$ref": "770"
},
{
"$ref": "773"
},
{
"$ref": "775"
},
{
"$ref": "778"
},
{
"$ref": "780"
},
{
"$ref": "782"
},
{
"$ref": "788"
},
{
"$ref": "791"
},
{
"$ref": "793"
},
{
"$ref": "796"
},
{
"$ref": "798"
},
{
"$ref": "800"
},
{
"$ref": "802"
},
{
"$ref": "805"
},
{
"$ref": "809"
},
{
"$ref": "868"
}],"$type":"Game.Traffic.RoadPoint[]"}
I tried making a new one , but stack overflow exception accurse. This code is not complete as it exceeds the limit for characters i can use to write here.
please add the code how you load/process the data from this json.
Your answer
![](https://koobas.hobune.stream/wayback/20220613043940im_/https://answers.unity.com/themes/thub/images/avi.jpg)