Putting it simple, I am trying to make a grill, and when a gameobject is “on” (colliding with) the grill I want to give it a cooked rate.
I thought maybe I could detect when the collision enters and then start counting and incrementing the cook rate.
It would work like:
cookRate is less than or equal to 25, it’s undercooked.
cookRate is greater than or equal to 26, its cooked.
cookRate is greater than or equal to 40, it’s burnt.
I came up with this but I am not sure if this would work at all.
` int _cookRate = 0;
private void OnCollisionEnter(Collision collision)
{
for(int i = 0; i < _cookRate; i++)
{
_cookRate++;
}
}
`