Skip to content

Instantly share code, notes, and snippets.

@alexson
Created January 13, 2022 09:48
Show Gist options
  • Save alexson/937d5c798a4dfa164c1fad8b66dcd04d to your computer and use it in GitHub Desktop.
Save alexson/937d5c798a4dfa164c1fad8b66dcd04d to your computer and use it in GitHub Desktop.
...
private void Update()
{
//if (!exploded)
// CheckOverlapping();
}
...
void FixedUpdate()
{
Counting();
}
...
public void Explode()
{
if (!exploded)
{
exploded = true;
//Debug.Log("Explode");
CheckOverlapping();
//Spawn effect
GameObject exEff = Instantiate(explosionEffect, transform.position, transform.rotation);
exEff.transform.position = bombRoot.transform.position;
exEff.transform.localScale = transform.localScale;
exEff.SetActive(true);
//Destroy this object
Destroy(gameObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment