- Home /
How do i call on variables from other scripts?
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. $$anonymous$$an, 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).
Your answer
Follow this Question
Related Questions
Changing variables in GUI? 0 Answers
How to create a gui button inside an if statement? 1 Answer
Inputing an Equation 0 Answers
Simple Backpack "Pick up and drop" 1 Answer