Error 0120 'An object reference is required to access non-static member 'UnityEngine.Object.name'

Every Time I try to use debug a part of my game i get the error mentioned above, but i have no idea how to fix it or what its caused by, so any help would be appreciated.
Here’s the code:

using UnityEngine;
using System.Collections;

public class DebugScript : MonoBehaviour {

	void OnTriggerEnter(Collider other) {
		Debug.Log (GameObject.name + " was triggered by " + GameObject.name);
		
	}

}

Hey bud, you were trying to access the type and not the read only parameter, which is reference as gameObject instead of GameObject.
Also, your debug will show up saying at both ends the name of the gameobject that has had its trigger entered.
Instead, I have simply replaced your first argument in Debug.Log() to ensure the correct path to your objects name affected by trigger, and finally the objects name that entered the trigger.

using UnityEngine;
using System.Collections;
     
public class DebugScript : MonoBehaviour 
{     
void OnTriggerEnter(Collider other) 
{
Debug.Log (this.gameObject.name + " was triggered by " + other.gameObject.name);     
}     
}

Cheers bud, hope that helped somewhat.
Take care.

Gruffy