When colliding with Trigger, i’d like to delete the object I hit, aswell as the objects parent…
It’s not quite working though:
function OnTriggerEnter(otherObject: Collider){
if(otherObject.gameObject.tag == "Player"){
playerScript.playerScore +=100;
Destroy (gameObject);
Destroy (parent.gameObject);
}}
Any ideas? Thank you in advance, sorry, I’m still the novice