Hello!
I need to do a simple explosion animation when i touch a cube, how can i do?
I have this function to destroy the cube.
if (Input.GetMouseButtonDown(0))
{
Ray ray = GetComponent().ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit))
{
Destroy(hit.collider.gameObject);
}
}
Thanks