Hi,
I have a project with a 2D character collecting bouncing coins I developed on Unity 5.3.4f.
The coins have a Circle 2D Collider and the character a Polygon Collider 2D and a script with this code :
void OnCollisionEnter2D(Collision2D collision){
switch (collision.gameObject.tag)
{
case "hazard":
scoreMinusOne ();
Destroy (collision.gameObject);
break;
case "coin":
scorePlusOne ();
Destroy(collision.gameObject);
break;
default:
print ("Incorrect tag");
break;
}
}
The code destroy coins when they collide with the character. Since I update to Unity 5.3.5f, the character bounces against coins before they get deleted. It seems like the Physics calculation and the OnCollisionEnter2D code are played in a different order in this version.
Any thoughts ?