Just like the question states, I need to call on variables from multiple scripts.
The context being used here is an Options menu. The menu will provide sliders for various adjustments to the game mechanics (Player speed, Lighting effects, etc.) But i need to know how to call on a variable in another script. For example. I'd like to set a slider that would call on the player's speed variable in my FPS Controller script, but I'd like to set my GUI menu up in one single separate script attached to a hot-key (probably "O")
I don't really know how to explain it better than that, hopefully someone can give me insight on calling variables from other scripts.
Answer by Eric5h5
Apr 25, 2010 at 04:48 AM
This is covered in the docs about accessing other game objects.
Thanks, I'll look over it. Man, you're always there first to answer my questions. Sir, you rock!
Answer by duck
Apr 25, 2010 at 06:08 AM
Very similar questions have also been asked and answered in detail many times before, so make sure you try searching the site too, before posting a question!
(although the search feature on this site isn't great - it's often better to google, like this custom unity search -, so apologies if you already did).
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
No one has followed this question yet.
My own GuiSkin on the script
Setting Scroll View Width GUILayout
GUI.HorizontalSlider not working
The name 'Joystick' does not denote a valid type ('not found')
Accessing Script From Other Script Causes Lag?