Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
  • Home /
avatar image
4
Question by Tom de Jank · Jan 08, 2010 at 10:45 AM · gameobjectvariablecommunication

Communication between objects and other scripts, variables and properties

hi there out in the UNITY3D universe, is there a way to read varialbes of a script from an other gameObject? I tryed with a static var, but its do not work. how can I solve this problem?

greetings from Berlin ThisIsTom

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
18
Best Answer

Answer by duck · Jan 08, 2010 at 10:48 AM

Yes there is, in fact there are many many ways. Start reading about it at these two manual pages:

  • Accessing Other Objects
  • Accessing Other Components

Also see this answer which gives more detail about creating "dragged references":

How can I access other scripts and their functions?

Static variables do have their uses, but they are generally not the best thing to use for general-purpose communication between gameObject scripts. Until you learn more about what static variables are particularly useful for, I would recommend to avoid using them, and instead learn the methods discussed in those manual pages.

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tom de Jank · Jan 08, 2010 at 11:31 AM 0
Share

thanks a lot for this great help

greetings

avatar image duck ♦♦ · Apr 01, 2010 at 11:28 AM 2
Share

remember to click the 'accept' tick icon if the answer solved your problem.

avatar image rhose87 · Nov 24, 2011 at 02:14 PM 0
Share

he forgot to accept the answer. thanks a lot anyway.

avatar image meat5000 ♦ · Jul 25, 2013 at 04:42 PM 0
Share

It seems the two links have since gone. Is there another instance one could reference?

Edit : yes they do indeed seem to be working again! Random weirdness.

avatar image MutualTeats · Aug 09, 2013 at 05:39 PM 0
Share

The links works perfect for me. duck, I would thumb your answer up, but I'm not allowed :)

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Accessing Variables within another gameobject's script 2 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Public variable in script different for every game object. 1 Answer

Change a Script Var of an Instantiated Object 1 Answer

How to save a gameObjects on a prefab and variables with a script? 1 Answer


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