• 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

Variable

Cancel

Cancel

All Questions

  • Unanswered Questions
avatar image

Jeremy-Borton answered

Referencing non static variables from another script? C# Wiki

Dec 14, '21 variable·different·non-static

2 Replies

23 Votes

avatar image

himanshugupta159 answered

How to make a global variable in Unity?

Jan 25, '19 in Help Room

5 Replies

10 Votes

avatar image

karak1985 commented

Get variables from other scripts

Jan 30, '22 javascript·variable

6 Replies

8 Votes

avatar image

youssefcraft answered

How do i disable a script from a different script?

Aug 27, '21 variable·disable·var

5 Replies

10 Votes

avatar image

dahal2871 answered

Is it possible to show Static Variables in the Inspector?

Dec 17, '20 prefab·variable·inspector·static·oafa

10 Replies

23 Votes

avatar image

Andrea_Marchetti edited

Accessing A Variable From Another Script

Apr 26, '17 javascript·variable·hud·accessing

4 Replies

3 Votes

avatar image

Pedras published

How to call a function from another script - getting error "Object reference not set to an instance of an object"

Mar 28, '16 error·variable·nullreferenceexception·function·reference

5 Replies

2 Votes

avatar image

atr0phy edited

Callback on variable change inside editor

Jun 13, '22 editor·variable·callback

3 Replies

24 Votes

avatar image

TheFishyDishy edited

Invisible Public Variable in Inspector

Aug 18, '21 variable·inspector·public

5 Replies

25 Votes

avatar image

dokuganryu20 commented

scene to scene variables

Jun 26, '18 scene·variable

4 Replies

8 Votes

avatar image

outsidergiant commented

How do I access information (eg, variables, functions, properties) on other objects from inside a script?

Mar 23, '17 variable·access·communication·oafa

2 Replies

8 Votes

avatar image

sharkbitgamesdev commented

Have a function to Wait until true?

Oct 28, '21 variable·yield·wait·continue

4 Replies

5 Votes

avatar image

Tarlius answered

how to acess Static variable in other scripts without extended functions?

Mar 18, '13 c#·variable·static·access

2 Replies

4 Votes

avatar image

SisterKy edited

Or If statements

Sep 13, '11 in Help Room

1 Reply

5 Votes

avatar image

Quarior answered

ERROR - An object reference is required to access non-static member Wiki

May 13, '18 variable·function·static·object reference·non-static

3 Replies

2 Votes

avatar image

Bren0831 commented

Calculating speed of rigidbody?

Mar 21, '17 rigidbody·variable·velocity·speed

1 Reply

4 Votes

avatar image

unity_UDFOHkLYjHpdwA commented

Raycast object tag check?

Oct 29, '20 gameobject·raycast·variable·tag

3 Replies

2 Votes

avatar image

ccrazy_GAMER commented

Changing a variable in one script using another script

May 28, '18 variable

2 Replies

4 Votes

avatar image

paul-masri-stone commented

Showing a textarea field for a string variable in inspector?

Dec 9, '21 variable·inspector

4 Replies

21 Votes

avatar image

mksnell commented

Set variable in script from a different script...

Mar 8, '18 gameobject·variable·set·different

3 Replies

0 Votes

avatar image

Socapex edited

how to create boolean Varibles ?

Jan 3, '11 variable·variables·boolean

3 Replies

0 Votes

avatar image

jellyberg commented

Whats the difference between public and static variable?

Jun 21, '13 variable·static·public

2 Replies

9 Votes

avatar image

changemaker edited

Passing Parameters by Value or by Reference

Jul 1, '20 variable·function·change·instance·method

2 Replies

4 Votes

avatar image

ahsen35813 converted comment to answer

Get variable from other GameObject's script Closed

Mar 30, '20 variable·getcomponent·other script

3 Replies

0 Votes

avatar image

ArkaneX edited

How to get Raycast to detect collision with Object?

Aug 19, '13 collision·raycast·object·vector3·variable

3 Replies

0 Votes

avatar image

instruct9r commented

Why woud i use var in C# ?

Oct 24, '15 in Help Room

1 Reply

14 Votes

avatar image

B4ttleCat commented

Reload a scene and resetting all variables

Aug 8, '17 variable·singleton·reload

3 Replies

3 Votes

avatar image

Rexor4321 commented

storing the value in a temporary variable problem

Sep 10, '17 c#·variable·temporary·pinball

1 Reply

1 Votes

avatar image

vozochris_1 edited

string + int = variable

Dec 6, '11 c#·variable·string·int

2 Replies

2 Votes

avatar image

3dpowermax commented

Sorting a list of GameObjects by accessing their int values

May 6, '15 gameobject·list·variable·sort

2 Replies

0 Votes

  • 1
  • 2
  • 3
  • 4
  • 5
  • ›
  • »

Followers

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Related Topics

c# javascript gameobject scripting problem variables static function array instantiate prefab getcomponent inspector string error class gui value reference access int script. boolean float public assign


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges