qualify it with a type name instead. Whats the problem here? Line 12
using UnityEngine;
using System.Collections;
public class PowerUpScript : MonoBehaviour {
HUDScript hud;
private string mainCamera = "MainCamera";
void OnTriggerEnter(Collider2D other)
{
if (other.tag == "Player")
{
hud = gameObject.Find(mainCamera).GetComponent<HUDScript>();
hud.IncreaseScore(100);
Destroy(this.gameObject);
}
}
}
The function Find is a static member of the class GameObject, which means that you have to access it using the type instead of the instance:
hud = GameObject.Find(mainCamera).GetComponent<HUDScript>(); //Notice the upper case G in GameObject to specify the class instead of the instance.
You appear to be searching for the MainCamera though and as long as your main camera is tagged as MainCamera you can easily access it through the Camera class instead:
hud = Camera.main.GetComponent<HUDScript>();
And as @Invertex says, you should put that code in a Start() of your script to avoid running it multiple times which is unnecessary .