- Home /
Accessing Variables Through Scripts
Hello, Does anyone one know how I can access variables through other scripts. I tried doing something like this:
var killplayer : movePlayer = gameObject.GetComponent(movePlayer);
killplayer.Destroy = true;
But that doesn't work....
Thanks in advance!
Comment
At which part does it not work?
Have you attached the $$anonymous$$onoBehaviour component 'movePlayer' to the same game object on which you have the above script?
Well.... I feel like a complete idiot now.... xD yep completely forgot that. Thanks! :D
@GuyTidhar you should post your answer so that the question can be closed :)
Best Answer
Answer by GuyTidhar · Mar 14, 2013 at 01:24 PM
At which part does it not work?
Have you attached the MonoBehaviour component 'movePlayer' to the same game object on which you have the above script?