Teşekkürler sorunum çözüldü sorun yaşayan arkadaşlar için kod:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour.
{
// Start is called before the first frame update.
private void OnMouseDown()
{
Destroy(this.gameObject);
Debug.Log("Objeye Tıklandı Ve Yok Oldu");
}
void Start()
{
}
// Update is called once per frame.
void Update()
{
}
}
OnMouseDown fonksiyonun içinde istediğinizi kodlayabilirsiniz.