Skip to main content

All Questions

-7 votes
0 answers
52 views

How To Access An Item In A Struct Which Is In An Array [closed]

I am making a tower defense game and used structs in an array and want to access an item in the structs. I don't want to use a 2d array as that can't show up in a unity editor. I tried tutorials and ...
Simon Y's user avatar
0 votes
0 answers
58 views

Why ToJson saves only {}? [duplicate]

Before this, I saved only one instance of the class in Json, and everything worked. Now when I try to save the whole array, nothing works for me. Please don't advise me to switch to some Newtonsoft. ...
Матвей Тинин's user avatar
1 vote
2 answers
59 views

How can I sort a list using multiple ways?

I have a ScriptableObject in unity [CreateAssetMenu(fileName = "New Food", menuName = "Prismalia/ScriptableObject/Food")] public class FoodScriptableObject : ScriptableObject, ...
Rudolf's user avatar
  • 31
0 votes
1 answer
81 views

Byte array and int transferring between C# and C++ in Unity DLL Integration

I am developing a Unity project where I've created a DLL in C++ to integrate with my C# scripts. The C++ function I've written is meant to receive a byte array and its size as input parameters. ...
Lucas B's user avatar
0 votes
2 answers
51 views

Cube Vertices and tris working unexpectedly

I am writing a short script in c# to create a cube in unity. Everything is working fine up until I mess up all the cube points and things. private Vector3[] GenerateVerts() { return new ...
PD6152's user avatar
  • 23
-1 votes
2 answers
101 views

In Unity why cant I append this game object to an array. Error: ArgumentNullException: Value cannot be null. Parameter name: source [duplicate]

Here is the code being use: private void start() { for (int i = 0; i < 5; i++) { GameObject card = Instantiate(deck[i], playersHandContent.transform); card.GetComponent<...
Logun Tetley's user avatar
0 votes
2 answers
169 views

How to store and handle large arrays in unity

In my unity project, I have a very large array of arrays of integers. It contains around 65 thousand arrays each of length 4. When I attempt to use this in my program, it crashes and unity shuts down. ...
Frank's user avatar
  • 13
1 vote
1 answer
105 views

How to read a JSON in Unity to make an Array of objects?

I am currently working on a Visual Novel project in Unity. To make the story, I used this website : https://twinery.org/ to make the script and the behaviour of buttons. Made a js script to transform ...
Jean Mahmoud 's user avatar
0 votes
0 answers
246 views

Memory Leak Native Array and UnSafeList

I am using Unity Native array that contains unsafelists. And Fallback allocation consume too much time. There must memory leak but I couldn't figure out. Here is my code: NativeArray < ...
Berkay Onur's user avatar
0 votes
2 answers
66 views

C# Populating Array Elements with For Loops

It may be the late hour of the night, it may be the ire of the gods. I've reread what should be as simple as can be countless times. Could some kind soul help me out here, what is going on? Goal is to ...
Nihlson's user avatar
  • 13
1 vote
2 answers
1k views

Trying to remove elements from an array in unity

I'm trying to make an old school styled light gun shooter in unity, I am trying to make it so when you defeat all enemies on screen, you move to the next section of the level. At first I used an enemy ...
Kevin 's user avatar
  • 25
0 votes
2 answers
62 views

Deserializing JSON (without dynamic) where array has multiple possible depths based on value of another property?

I am trying to deserialize the following JSON without using dynamic as it is not supported by my system: https://raw.githubusercontent.com/vansha/Two10.CountryLookup/master/Two10.CountryLookup/region-...
mike's user avatar
  • 91
-3 votes
1 answer
50 views

converting object to json doesnt show empty List<object> unity

private void Start() { a data = new a { name = "karan", l = new List<object>() }; Debug.Log(JsonUtility.ToJson(data)); }...
Karan Gupta's user avatar
0 votes
1 answer
64 views

Unity: Change volume of an AudioSource array

I'm new to coding and I have a question. I want to mute every AudioSource inside my array but it doesn't seem to work. This is the error message I get: error CS1061: 'AudioSource[]' does not contain ...
StonedPineapple's user avatar
1 vote
1 answer
71 views

Array.Sort is changing unspecified arrays in unity

I am trying to sort an array, and a list of indices, but I want the original array to stay the same. When I use the Array.Sort() function, it not only sorts the specified arrays, but also the ...
Frank's user avatar
  • 13

15 30 50 per page
1
2 3 4 5
34