Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [json]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
41 views

Do a quiz from web api data

i'm new to unity and i want to do a quiz using data coming from a web api I was able to retreive data from the api but i couldn't make the game logic with them This is where i arrived ...
user avatar
0 votes
0 answers
37 views

saving and retreiving parameters from file dynamically

I am trying to write a system for saving and loading a bunch of parameters at runtime. I have a central class CentralParams that holds all the parameters. Each ...
user avatar
0 votes
1 answer
41 views

JsonUtility deserializes list of strings, but all strings come out empty [closed]

What I have JSON file ...
user avatar
  • 599
0 votes
1 answer
52 views

How to look up items by name in lists loaded from JSON data?

I'm using a JSON file for loading texts and dialogs and here's my JSON file: ...
user avatar
  • 599
0 votes
0 answers
35 views

How to save a class full custom property types and their data to disk

Background: My app is a sandbox with a large number of parameters that I want to be able to easily add / selectively expose to the user, edit during runtime through the game UI or from the Unity ...
user avatar
1 vote
1 answer
221 views

Unity - How to create a game-save with a preview image?

I want my game-save to be shown with a preview image. This is often seen in City Builder games: The game-save usually has a name, a date and often also provides a preview of the build city (just a ...
user avatar
0 votes
1 answer
30 views

Equipped weapon does not appear in JSON data

I'm trying to make an RPG style game with equipment using ScriptableObject, but whenever I equip the item, it does not register in my JSON data. Here is the script ...
user avatar
0 votes
2 answers
80 views

How can I serialize lists to JSON on mobile?

I'm having difficulties serializing lists with the built in JsonUtility. I eventually figured out this just isn't possible with its limited capabilities. As much as I'd like to use Newtonsoft, I ...
user avatar
  • 125
-1 votes
1 answer
111 views

Deserialization of JSON from Firebase to load data

i was wondering if you could help me with an issue i have with firebase and databases! I have a class that saves variables into an array. i have managed to send that json file to firebase and i can ...
user avatar
0 votes
0 answers
42 views

Saving JSON to firebase

I want to integrate Firebase to my android/iOS game. So far in production I used JSON to save a class into the devices PersistentDataPath and load them accordingly. I did follow the firebase ...
user avatar
0 votes
1 answer
71 views

Parse Data on runtime into JSON

I have been trying to work out a subscription form for my game and thanks to you guys here, I came to a solution which works but still needs some changes. The idea is to have an input field in the ...
user avatar
0 votes
1 answer
215 views

Deserialize only some fields from a JSON file

I'm trying to parse a very large JSON string in Unity. I do not need all the fields and I can't create a class with all the members. It appears that all examples I have found, including the official ...
user avatar
  • 103
0 votes
1 answer
769 views

How to properly format classes for JSON deserialization with JSON.net for Unity?

**UPDATE: This answer has been solved and this post updated to ** I am creating an inventory system and decided to keep a master list of all the items. The goal is to use Newtonsoft's JSON.net to ...
user avatar
0 votes
0 answers
136 views

JSON deserializing 'nested' Array

Greetings! I'm working on a class that loads and parses .json files and returns information from the loaded .json, but I have problems reading the nested arrays of my .json files. Turning the ...
user avatar
0 votes
1 answer
91 views

Minecraft: `foot_size` doesn't work

I'm making an add-on that lets the player step over 1-block high blocks and the foot_size property is exactly what I'm looking for. The documentation says the following: "Sets the number of ...
user avatar
  • 101
1 vote
1 answer
318 views

Json Libgdx serialize / de-serialize a Object Map of Object Maps

Any one have any ideas on how I can serialize / de-serialize an ObjectMap<Enum, ObjectMap<String, Object>>(); (Object is usually a String Integer ...
user avatar
1 vote
1 answer
908 views

Unity3D - JsonUtility returns empty string

i have the problem that when I convert an instance of highscores through JsonUtility.ToJson the value of my value of it is always {"highscoreEntryList":[{},{},{},{},{},{},{},{},{},{},{}]}... ...
user avatar
  • 11
0 votes
0 answers
47 views

How do I add data to a Dictionary after I deserialize the data for the class?

I'm getting a null reference exception on "AddEmpireView()" and I cannot figure it out for the life of me. Here's the class: ...
user avatar
0 votes
1 answer
597 views

JsonUtility is throwing exception when there is \" in the string

The following is my JSON file: ...
user avatar
  • 101
0 votes
0 answers
63 views

Facing issues trying to Parse JSON in Lua

Problem statement: Need help trying to load a JSON file into a table array in Lua for Corona SDK development. My Objective: Call specific data from JSON file to my application by using key value ...
user avatar
0 votes
0 answers
57 views

Questions about Jrpg NPC events (Unity C#)

So, I'm trying to wrap my head around something. I've got my basic quest system up and running for my rpg style game. Right now I'm taking a look at NPC events and triggers that as I see it have two ...
user avatar
0 votes
2 answers
563 views

Unity - Save/load in a sandbox game, how to instantiate saved objects

I have a game where a player can place GameObjects. I can save/load this GameObjects data with using JSON, for example its position, but I cannot think of a good way to tell my save-file (and my ...
user avatar
  • 1,863
0 votes
1 answer
939 views

How to encode a save game / game state as a string?

I'm building an HTML game. For this game I want to implement a save-feature that should work like in some already existing games: The user can chose export, this ...
user avatar
  • 101
0 votes
1 answer
409 views

Get JSON property dynamically in Unity C#?

I'm saving game data into JSON, however basically I can't get property with just string just like in JavaScript. This makes my code to write so many if/switch statements, looks very not clean, hard ...
user avatar
  • 1,101
4 votes
2 answers
1k views

Is there a way to hardcode a JSON file into a Unity build?

I'm currently creating an external tool to generate dialogues that are exported as JSON files. The idea is that after you create a dialogue (as a JSON), my main Unity project reads that file and ...
user avatar
1 vote
1 answer
205 views

unity 3d loading data from json problem

i am trying to practice on loading data from json files my problem is about when i try to load the sprite path from the json file to load the image icon from the floder that contain it, i manged to do ...
user avatar
  • 11
1 vote
1 answer
93 views

How to parse User-defined types from String?

I am trying to save data about various entities in each Level in my game in a JSON file and load it at Runtime(Like a Scene file in Unity). I can save simple stuff like floats and ints and parse them ...
user avatar
2 votes
6 answers
9k views

unity JsonUtility.ToJson returns empty string

I am trying to use Unity's built in json serialization. It produces empty string. I do not understand why. (I was trying to use NewtonSoft Json.Net but that wasn't working either even though I was ...
user avatar
0 votes
2 answers
1k views

Why can't I read this JSON file?

I get an error every time I try to parse this .json file. Here is the error: ...
user avatar
1 vote
1 answer
256 views

Godot: does parse_json accept multiple JSON objects?

If I had a JSON file that had multiple objects, can the method read through without some form of exception?
user avatar
0 votes
1 answer
3k views

Loading a list of items from JSON, all entries are null

(I posted a very similar question here recently and the response I received was helpful. But I have been advised to start a new question, and here it is.) I am developing a Unity game which includes ...
user avatar
  • 101
0 votes
1 answer
3k views

Trying to load .json questions and answers into a multiple-choice quiz game in Unity [duplicate]

I am developing a Unity game which includes a multiple-choice quiz. I've placed what I believe is a properly-formatted .json file (the quiz question, four answer choices, the correct answer, and an ...
user avatar
  • 101
2 votes
1 answer
5k views

Unity JSON parsing Array of Objects problem - error: JSON must represent an object type

I'm trying to use Json to hold game dialog in a text asset file. I've tried to make a barebones project to test this and it is failing with the Error Message: ArgumentException: JSON must represent an ...
user avatar
1 vote
5 answers
11k views

Parse JSON in Unity

I've this JSON code like below. How do I parse it to the objects on code below? ...
user avatar
0 votes
1 answer
282 views

POST JSON method does not work when project has been exported to WEBGL and uploaded to firebase hosting

I have a database set up on firebase and when i run my game in the unity edtitor and as a standalone exported Windows .exe file, the call gets made correctly to the database and JSON data gets posted ...
user avatar
  • 1
0 votes
1 answer
4k views

JSON Parse (Invalid Value)

My settings.json (generated with JsonUtility.ToJson): { "masterVolume": 0.10000000149011612, "fullScreenMode": 1, "cheatsEnabled": false } Offending ...
user avatar
  • 81
2 votes
1 answer
414 views

LibGDX Json writes only part of class

Hello I've been developing this game for awhile and now trying to implement save data via Json. I've gotten to where when the app is first launched it will write the Json file with the variables I ...
user avatar
  • 63
1 vote
1 answer
899 views

ds_map_find_value returning number instead of array

Currently messing around on how to make a text engine in GameMaker and figured I would hold all my conversations in JSON format stored in a .txt file, which I'll convert into a ds_map and draw the ...
user avatar
1 vote
0 answers
63 views

Creating Customization System in Unity

I'm making a game with customization system for both characters and weapons and I don't know exactly what's the best way of doing the customizations themselves. I'm thinking of creating separate ...
user avatar
  • 143
0 votes
1 answer
147 views

Instantiate a sprite using json data value (C# Unity)

Here is my code : BetBoard_Test.cs ...
user avatar
0 votes
1 answer
808 views

C# JSONs not formatting array of objects stored inside another object.

I know the title is a bit confusing because I don't really know how to phrase this. This is what I have: ...
user avatar
2 votes
1 answer
2k views

Invalid character '' in input string at LitJson.Lexer.NextToken ()

Here's my script: ...
user avatar
  • 33
1 vote
1 answer
4k views

Could not find a part of the path "/jar:file:/data/app

I need a hand on this . On Unity Editor this pretty works fine but when i'm building the apk and try to run my Language Changer function it can't find the path . ...
user avatar
  • 33
2 votes
1 answer
83 views

Implementing modular game control with JSON/etc. config file?

I'm having trouble wrapping my head around a method to compartmentalize my game control scheme within the game loop in an efficient way. Currently this is basically how my control works in bad ...
user avatar
  • 23
0 votes
1 answer
38 views

Data not showing properly as per my field in the game

I made the game in android in this game i want first login and registration through JSON object. I have a API link where JSON Object send data from that url to the server but in my server i get the ...
user avatar
0 votes
2 answers
112 views

Formatting Unity data for communication with a REST API

I am pretty new to unity but I am not new to programming. I am building a Hololens application in Unity 2017.2 and it communicates with a REST api that I built. I am using Unity as a front end more or ...
user avatar
1 vote
1 answer
680 views

Can't deserialize parameters from JSON in LibGDX

I am quite new to JSON and I have been having trouble with this data-driven asset manager (not my code). I have been trying to deserialize parameters for my TmxMapLoader object from JSON. It takes the ...
user avatar
0 votes
2 answers
751 views

Still having problems using Json data in Unity

I have the following classes and json file, i thought id followed the documentation exactly but I am clearly wrong. Can anyone see why I get an error just saying : INVALID VALUE in my unity console: ...
user avatar
1 vote
1 answer
9k views

How to create JSON file in notepad that will hold my positional vector3 data for one type of object

I'm trying to get my head around using JSON files to store level data . Specifically in this example is to make my walls. (its a top-down game like pacman). Each wall prefab is a 1x1x1 cube. I just ...
user avatar
0 votes
1 answer
417 views

How can I parse different types of objects from JSON?

I'm trying to save the player's inventory as a JSON data but I'm having a problem. I have a class Sword which extends an abstract class ...
user avatar