okay guys so i am pretty new, and im stumped a bit,m basically using everything from the flappy bird tutorial mechanics… anyways so here are the details. i have coins on the screen, ive managed to give them sound effects awesome, okay so i need them to disappear… the only thing ive tried that works is
"
using UnityEngine;
using System.Collections;
public class Column : MonoBehaviour
{
**void OnTriggerEnter2D(Collider2D other)
{
if (other.GetComponent<Bird>() != null)
{
//If the bird hits the trigger collider then
//tell the game control that the bird scored.
GameControl.instance.BirdScored();
Destroy(gameObject);
}**
}
}
"
now i understand that destroys everything including the script… and my game is crashing because its trying to find these destroyed remains, anyways so i’m sure you already know my question now, but i will still ask it, what exact code do i need to basically say after the score increases make the object disappear until it needed again. (or needs to re-spawn etc) i’ve been trying to figure out the sound for days now finally got it, felt great when my coins started disappearing with a cha’ching sound but a keep running into walls here, and im running out of free time this is the last thing i need to polish off for now, so if anyone can help me out i would greatly appreciate it, last bits of details, i have 2 different coins, both in a separate prefab of their own, they are literally just single coins in the prefabs (except the one has 5 overlapping each other to give 5 poiints per coin. ) if my grammer and typing is bad i apologize im super exhausted and heading to bed now lol, thanks again