Hello people. I am new to Unity and been trying to write a code for my first game. Almost everything was done but this notification poped out:
“NullReferenceException: Object reference not set to an instance of an object
GameHelper.Update () (at Assets/Scripts/GameHelper.cs:44)”
I know there are many different questions that had been asked about the same topic, but I couldn’t find answer for mine. Any help would be much appreciated!
Here is my cod:
42 if (SelectedBirdHelper != null)
43 {
44 SelectedBirdHelper.GetComponent<Rigidbody2D>().isKinematic = false;
45 SelectedBirdHelper.GetComponent<Rigidbody2D>().AddForceAtPosition(
46 SelectedBirdHelper.transform.right* 1000,
47 SelectedBirdHelper.StartPosition