All Questions
Tagged with unity-game-engine arrays
618 questions
1
vote
1
answer
78
views
Function is not working, but gives no error
I'm new to C#. I'm trying to make game in Unity. These functions are necessary for changing in-game tabs with help of a button.
public string check;
public CanvasGroup hydrogenScreen;
public ...
-1
votes
1
answer
30
views
SetActive for multiple cameras
I have a working script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Interactive_map : MonoBehaviour
{
public Camera[] cameras;
void ...
0
votes
2
answers
97
views
Image array not showing in Unity inspector
I'm trying to create a lives system of five hearts in a game I'm making, so to do that I created a life tracked script:
using System.Collections;
using System.Collections.Generic;
using Microsoft....
-1
votes
1
answer
53
views
is this scriptable object script for unity correct?
using TMPro;
public class InstanziaOggetti : MonoBehaviour
{
public ObjectScriptable[] ObjectX;//name of the scriptableObject
public TMP_Text text;//3d text that will be instantiated above the ...
0
votes
0
answers
60
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. ...
0
votes
0
answers
33
views
Unity Can a variable, changing array be assigned for one spot in an array
So I might already have an answer for this but if I have a 2d array is there anyway to have a spot be in array that can change sizes and content?
If not, how could I go about this? Can lists do this? ...
1
vote
2
answers
77
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, ...
0
votes
1
answer
61
views
Unity sciprtableobject containing just a list of 2 element arrays
I'm attempting to put a list of 2 element arrays into a scriptable object. I've finally managed to avoid all compiler issues, but I'm not getting anything to populate in the inspector. I'm thinking I ...
0
votes
1
answer
53
views
update multidimensional array in unity
I'm currently working on a match-3 game genre in the Unity engine, and I'm using some gem artwork for it. I've encountered a situation where, after storing the gem positions in a 2D array and swapping ...
0
votes
1
answer
99
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. ...
0
votes
1
answer
163
views
How can I use a Vuforia 4x4 matrix to retrieve the position of an area target?
I am currently working on an application utilizing Vuforia and i need to extract position coordinates (x, y, z) from a 4x4 transformation matrix of an area target.
Here is the method VuMatrix44F i use ...
0
votes
2
answers
90
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 ...
-1
votes
2
answers
229
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<...
0
votes
2
answers
389
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.
...
1
vote
1
answer
226
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 ...