stef538 42 Posted December 19, 2014 Hey guys, so i'm trying to acces a variable from another class by using this line of code RadioControl.Controlscript rcs = new RadioControl.Controlscript(); and then if (exists(rcs.currentvehicle)) //currentvehicle is a vehicle i defined{ Game.displaytext("it works", 2000);} but whenever I do this it gives me an error: Object Reference is not set to... Also they are all public voids and currentvehicle is also public. Hope you can help me!Regards, Steff Share this post Link to post Share on other sites
Jitnaught 370 Posted December 19, 2014 Can you post the code of the class? Share this post Link to post Share on other sites
byteMe420 64 Posted December 19, 2014 because rcs is null or currentvehicle is null... im sure you know that though so i dont get what you are trying to even ask from people here... are you asking us what the exception means? i say this because you need to understand scope... you always post code asking for help but the code you post doesnt tell anyone what scope your objects are in so your code can't even be understood properly... first learn how to ask for help because you aren't clear in what you are asking... if you already knew what the exception means then i suggest you read about scope in c#. And then post some proper code and ask your question. And btw exists and displaytext dont exist... we are using c# and capitalization is important... not sure about crap langs like vb but if you use c# then capitalize properly Share this post Link to post Share on other sites