I have two objects - a bunch of asteroids and a sphere-CollisionSphere. Asteroids on collision with the sphere have to be destroyed and the sphere has to increase in size. As of now, the asteroids are getting destroyed- no problem however the size doesn’t seem to be changing of the sphere.
Could someone please help me…
this is my code
Vector3 temp;
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.name == "CollisionSphere")
{
//Destroy(gameObject);
gameObject.SetActive(false);
temp += new Vector3(2, 2, 2);
transform.localScale = temp;
}
}