- Home /
Question by
ibps13 · Oct 20, 2012 at 09:06 PM ·
c#getcomponent
Getcomponent unity 4b11
Hi,
Try this on unity 4b11 I have a gameObject "teleport" with this script:
GameObject obj = GameObject.Find("Fraise");
ControllerSystem controllerSystem = obj.GetComponent<ControllerSystem>();
if ( controllerSystem.GetNumberOfKey() == 1 && obj.CompareTag("Player"))
when my gameObject with tag "Player" hit collider of teleport, message return : NullReferenceException: Object reference not set to an instance of an object
`GameObject obj = GameObject.Find("Fraise");` is finded but not ` ControllerSystem controllerSystem = obj.GetComponent();`
This work fine on 3.5.6f4...
What is wrong ? thanks !
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers