Hopefully this is an easy fix, but I'm getting an error for trying to access the Rigidbody2D on my LevelManager gameobject. Now, I would understand this no problem, except I'm not trying to access my LevelManager anywhere. At least not intentionally. I found the line of code that is causing the error is here:
void Awake ()
{
this.GetComponent<Rigidbody2D> ().velocity = new Vector2 (2f, 10f);
}
This is a method on my BasePickUp abstract class. This class has several child classes that are implemented on a few pick ups. I tried changing 'this' to 'gameObject', but got the same results. And the code is doing what I want. If I take it out, the pickups just fall slowly down the screen, put the code back in and the pickups shoot off in a certain direction just like I want. So it is working, but it's also causing this weird error. Any ideas?