Having some trouble destroying something

I have a 2d project, I’m writing a script to cast a ray into colliders… I want to delete the collider I click on, but even though I’m probably staring the answer straight in the face in the documentation I can’t figure out how to get the Gameobject I am clicking on. I am able to get the transform, but I can’t use Destroy on the transform component. I need the whole game object. please help

//Player Script

//Inspector Variables

var	EditableTagName : String;
var RaycastLength 	: float;
var GOtoBeDestroyed : GameObject;
var BlTriPLUS : GameObject;
var BlTriMINUS : GameObject;

var hit : RaycastHit;
var ray : Ray;


var sPlayer1Score : String;
var sPlayer2Score : String;
var fPlayer1ScoreNumber : float;
var fPlayer2ScoreNumber : float;
var fMoveRectangleDownYP1 : float = 0;
var fMoveRectangleDownYP2 : float = 0;



//***************SCOREBOARD***************************

function OnGUI () {

    GUI.Label (Rect (100, 100, 1000, 200), "ScoreBoard");

       sPlayer1Score = "Player One's Score is: " + fPlayer1ScoreNumber;
       sPlayer2Score = "Player Two's Score is: " + fPlayer2ScoreNumber;    
    
  	 GUI.Label (Rect (130, fMoveRectangleDownYP1, 200, 200), sPlayer1Score);
	 GUI.Label (Rect (130, fMoveRectangleDownYP2, 200, 200), sPlayer2Score);
   
    
}






function Update () 

{

//Use the mouse button to select GameObjects during gameplay

//****************************************************************************
if(Input.GetMouseButtonDown(0))
	{
	print("Coder Message: Left Mouse Button Has Been Pressed");
	
	ray = Camera.main.ScreenPointToRay(Input.mousePosition);

		if (Physics.Raycast(ray,hit, RaycastLength))
			{
				if (hit.transform.tag == EditableTagName)
					{
						//gameObject.hit.transform.tag
	
						
						BlTriPLUS.transform.position = hit.transform.position;
						
						//Destroy(hit.GameObject);
						Destroy(hit.GameObject);
						
						Instantiate(BlTriPLUS);
		
			
						print ("An object has been hit with a ray");
						
					}
			}
		else
		{
		print (ray);
		print ("you missed");
		}
	}


//****************************************************************************
if(Input.GetMouseButtonDown(1))
	{
	print("Coder Message: Right Mouse Button Has Been Pressed");
	
	ray = Camera.main.ScreenPointToRay(Input.mousePosition);

		if (Physics.Raycast(ray,hit, RaycastLength))  //if ray is cast
			{
				if (hit.transform.tag == EditableTagName) // if the ray hits something tagged
					{
						
	
						
						BlTriMINUS.transform.position = hit.transform.position;
						
						Destroy(hit.transform);
						
						Instantiate(BlTriMINUS);
		
			
						print ("An object has been hit with a ray");
						
					}
			}
		else
		{
		print (ray);
		print ("you missed");
		}
	}
}

im not to good with js but have you got

function OnMouseButtonDown(0) // and the other one
{
Destroy(gameObject);
}

on b1trinus and what ever the other one was

OK, you helped me figure out that I need to re-organize my identifiers and game objects, but I still need to know how to assign the hit.transform to an identifier, or a game object, so I can use that identifier/gamobject to properly call Delete on it…

I have a ton of the same Gameobjects in the scene, all tagged with the same thing, when I click on one I want a new prefab to be instantiated instead of the clicked object. (rather than on top of it, which is happening now)

Destroy(hit.GameObject) is wrong.

Typically .gameObject (lowercase g) is the shortcut to the GameObject something is attached to but it’s not available in RaycastHit.

But there are other options-

Destroy(hit.transform.gameObject);
Destroy(hit.collider.gameObject);
Destroy(hit.rigidbody.gameObject);

awesome thank you