Been following along the old 2D platformer video and I ran into this issue that I can’t seem to find an answer for online.
Enemy enemy = hit.collider.GetComponent<Enemy>();
if (Enemy != null)
Debug.Log(“We hit ” + hit.collider.name + ” and did ” + Damage + ” damage.”);
I keep getting an error saying “Enemy is a Type which is not valid in the given context”.
Any help would be appreciated.