• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges

Static Variable

Cancel

Cancel

All Questions

  • Unanswered Questions
avatar image

Tanoshimi2000 answered

any way that I can see which script has changed the variable?

Jan 10, '21 debug·static variable

2 Replies

0 Votes

avatar image

FlippingFlopper asked

good way to get reference of transform of newly instantiated player object?

Oct 27, '20 referencing·static variable

0 Replies

0 Votes

avatar image

HBishop commented

Singleton and multiple scene data

Jul 30, '20 singleton·referencing·additive·static variable

1 Reply

0 Votes

avatar image

phyzxengr published

Editting a static variable?

Jul 5, '20 static variable

1 Reply

0 Votes

avatar image

farmvillehd edited

Reference a static variable from an instance

Jun 24, '20 reference·instance·instances·static variable

2 Replies

1 Votes

avatar image

ruimcp95 published

Static value “lost” in Unity when called on second script

Jun 4, '20 in Help Room

0 Replies

0 Votes

avatar image

Prune_Tracy commented

C# - How to set the sprites in a Static Sprite[] array

Jun 1, '20 arrays·static variable·spritemanager

1 Reply

1 Votes

avatar image

SirDodgy edited

Acessing static variable from Entities.ForEach

May 14, '20 dots·static variable

1 Reply

0 Votes

avatar image

icehex edited

Data from a simple singleton / static class return null

Apr 29, '20 nullreferenceexception·static·singleton·static variable·static-function

1 Reply

0 Votes

avatar image

Fragsteel edited

Execution order of static variable value change in update

Mar 10, '20 static variable·execution order

1 Reply

0 Votes

avatar image

xxfelixlangerxx asked

Get public static list

Feb 29, '20 in Help Room

0 Replies

0 Votes

avatar image

alwayscodeangry commented

Bomberman - bombAmountScript

Feb 23, '20 function call·static variable·bomb

1 Reply

0 Votes

avatar image

Tuonela93 commented

How to avoid storing the same resource for each gameobject?

Dec 31, '19 gameobject·inspector·resources·efficiency·static variable

1 Reply

2 Votes

avatar image

tillmonkthered commented

Scripts/buttons getting old (prefab?) values of variables

Jul 27, '19 prefabs·variables·buttons·prefab-instance·static variable

1 Reply

0 Votes

avatar image

zulaikhasalahuddin published

How do add a random sprite from my sprite list to scroll snap ?,I want to know how do i add new sprite in Second scene under scroll snap when user clicks on the button in the first scene.

Jun 24, '19 list·random·sprites·scroll·static variable

0 Replies

0 Votes

avatar image

$$anonymous$$ edited

Public static variable not updating from void Start ()?

Mar 5, '19 static variable·public static

2 Replies

0 Votes

avatar image

Collects commented

Fnaf Rebot, not working with, Door.

Feb 3, '19 coroutine·bool·death·static variable

1 Reply

0 Votes

avatar image

whatevergeek answered

Game freezes after restarting.

Jan 31, '19 c#·scripting problem·static variable

2 Replies

0 Votes

avatar image

surfuay answered

Tracking Kills

Jan 15, '19 ai·static variable

2 Replies

0 Votes

avatar image

Zymurer commented

serialize static fields

Dec 14, '18 serialization·field·static variable·serializefield

1 Reply

0 Votes

avatar image

SkaredCreations commented

If I declare and initialize a public static variable in a prefab, will that variable retain its value or reset every time the prefab is instantiated?

Oct 12, '18 c#·scripting problem·prefab·static variable

1 Reply

0 Votes

avatar image

tormentoarmagedoom commented

a static variable resets whenever i enter again the update method

Jun 27, '18 in Help Room

0 Replies

0 Votes

avatar image

FlippingFlopper answered

accessed to a static variable but not getting it's value.

May 1, '18 static variable

1 Reply

0 Votes

avatar image

theredace answered

How does a singleton maintain a persistent value?

Apr 29, '18 singleton·static variable

1 Reply

0 Votes

avatar image

Glurth commented

Does reading/changing Static variables constantly affect Performance or get Garbage Collected?

Jan 20, '18 in Help Room

1 Reply

1 Votes

avatar image

uesugichezt commented

Copy static Dictionary value for local change

Dec 16, '17 dictionary·static variable·local variable

0 Replies

0 Votes

avatar image

EJMVR commented

Script attached on prefab; cannot attach "text" component

Dec 12, '17 in Help Room

1 Reply

0 Votes

avatar image

darknessfell asked

Game freezes when restarting the game

Nov 18, '17 in Help Room

0 Replies

0 Votes

avatar image

EdwinChua answered

Using static methods to transform a position

Oct 2, '17 transform.position·static·static variable

1 Reply

0 Votes

avatar image

osn132 commented

How do I increment static variable from another script?

Sep 3, '17 static variable

1 Reply

0 Votes

  • 1
  • 2
  • 3
  • ›

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Related Topics

static c# scripting problem variable unity 5 javascript gameobject inspector global variable transform variables instantiate reference accessing scripts fadein static-function static variables static class instance singleton serialization loadlevel transform.position coroutine sprites
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges