Alright, so I’m looking to destroy an object, but only when the “player” object is touching it, and then when the left mouse button is clicked. This is what I have set so far, it’s not returning any errors, but it’s not doing anything either. Without the “Input.GetMouseButtonDown(0))” part it works, destroying the object on collision.
void OnCollisionEnter(Collision other)
{
if(other.gameObject.name == "Player" && Input.GetMouseButtonDown (0))
{
Destroy(gameObject);
}
}
}