- Home /
How to check for a missing class ( error CS0103 ) and act accordingly
Hi,
I would like to make my code aware of a missing class and act accordingly.
So let's say that I have a class called "InputBroker", if it exists then I use it, else I call directly the Input manager.
Currently I get the following and expected error: error CS0103: The name `InputBroker' does not exist in the current context
how can achieve this? I am using c#.
Thanks for your help,
Jean
Answer by DaveA · Mar 17, 2011 at 07:32 AM
Use the string version of GetComponent, get by name. If it returns null, it does not exist. I would imagine if you need a class, use the base class 'Component' (for variable type, say)
Answer by msassman · Feb 23, 2012 at 11:17 PM
could some one help me it came up w/ the same error but i cant fix it it says "Error 'RotationX' does not exist," yes I am using C# so please help me
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Random animation 2 Answers
Question about classes C# 1 Answer