About 20,200,000 results
Open links in new tab
  1. Get an array from other script - Questions & Answers - Unity

    Nov 21, 2013 · To access that in a different script, you could first make it static. You could also make a variable in the other script that would be the Game Object that the script with the array …

  2. c# - Get list from another script in unity - Stack Overflow

    Feb 2, 2021 · I would like to get a value from a serialized list that is on another script. How can I do that? This is my list: [System.Serializable] public class Level { public string Name; public …

  3. How to get a variable from another script in Unity (the right way)

    Dec 2, 2020 · Getting a variable from another script in Unity can be pretty straightforward. In fact, even if you’re only just getting started with Unity, chances are you’ve already created a public …

  4. Access array from another object/script c# - Unity Discussions

    May 13, 2011 · I have my main script with the following attached to a GameObject called “World”… public class WorldControl : MonoBehaviour { public byte[,,] worldArray; // Use this …

  5. c# - Make an array out of scripts in Unity? - Stack Overflow

    May 7, 2025 · There is no class Script, so you won't be able to do it this way. Think about what your three scripts have in common: At the very least, they all derive from MonoBehaviour. So …

  6. How to access a variable from another script in Unity c#

    Mar 19, 2016 · What you need are getters and setters. Basically it is a way of getting and/or setting variables in classes (or scripts in this case) from external code. There are many ways …

  7. unity game engine - Accessing a variable from another script C

    You first need to get the script component of the variable, and if they're in different game objects, you'll need to pass the Game Object as a reference in the inspector. For example, I have …

  8. How to reference an array of scripts from another script in Unity

    Apr 22, 2014 · Basically in Unity I needed a quick way to reference a list of scripts from another script. The idea is to have a “main” script holding a list of sub-scripts used to create instances …

  9. import an array or a list from another script - Unity Engine - Unity ...

    Jan 21, 2021 · There are a few ways to connect scripts, and which is the right one depends on the use case. You could, Put the scripts on the same game object, then …

  10. unity - Access gameObject array value from other script - Game ...

    Jun 16, 2017 · I have attached certain gameobject capsules with the array in the editor as shown in the figure below and I'm trying to access the values of array to another script. But I get null …

  11. Some results have been removed
Refresh