With this code i am finding the texture that my player is walking on. When my player move to other texture i want to change a bool to false and stop. But it’s always working. Always making that bool false. How can i fix this?
void Değiş()
{
int terrainTextureIndex = terrainDetector.GetActiveTerrainTextureIdx(transform.position);
switch (terrainTextureIndex)
{
case 0:
çalıştı = false;
break;
case 1:
çalıştı = false;
break;
case 2:
çalıştı = false;
break;
case 3:
default:
çalıştı = false;
break;
}
}