Hi.
I just can’t get it working. I tried to see other solutions but I can’T see what I did wrong.
I have a simple game where you just avoid obstacles. Those obstacles travel towards the player (cube). Behind the player I have wall that on collision testroyes obstacle.
I added 3d text and I just don’t know how to set it to count score.
void OnCollisionEnter(Collision col)
{
if (col.gameObject.name == "Obstacle(Clone)")
{
Destroy(col.gameObject);
}
}