Try this
..unknown
csharp
2 years ago
849 B
11
Indexable
void OnTriggerEnter2D(Collider2D Other)
{
if (Spawn == false)
{
// Place spawning logic outside of the loop
Instantiate(puyo2[puyotypeIndex], new Vector2(-12.5f, 5f), puyo2[puyotypeIndex].transform.rotation);
Spawn = true;
dropSet++;
}
// Handle collisions based on layers
if (Other.gameObject.layer == 3 || Other.gameObject.layer == 2)
{
Falling = false;
Rotating = false;
Left = false;
Right = false;
Spawn = false;
}
else if (Other.gameObject.layer == 4)
{
Falling = true;
Rotating = true;
Left = true;
Right = false;
Spawn = false;
}
else if (Other.gameObject.layer == 5)
{
Falling = true;
Rotating = true;
Left = false;
Editor is loading...
Leave a Comment