- Home /
Changing of Variables (Big Noob Question)
Hello, sorry for asking such a simple question. I hope it's fast to answer so I dont take away much time from any of you. Anyways, in my small Unity Game, I have a script called "PlayerData.js" within this is a bunch of public variables (such as health, score, etc.). However, I have a second script called "ZombieAttack.js". Within this script, I want to be able to change the varaiable called "PlayerHealth" within the "PlayerData.js" script. Is this possible? If so, how?
Just for clarification, essentially I want to change a public variable defined in a script, with another script.
Thanks!
Answer by HappyMoo · Jan 20, 2014 at 03:51 AM
static variables...
http://unity3d.com/learn/tutorials/modules/intermediate/scripting/statics
Please go through the Learning $$anonymous$$odules and don't ask questions anymore that are explained there.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
multiple instantiate object script help 2 Answers
Help, How can I get variables? 1 Answer
JavaScript Beginner: Menu Help 2 Answers
How do I make a respawn system? 1 Answer