Object Collision Only Destroys First Collision

I am working on a 2D platformer where lava rises up and destroys platforms over time. The lava moves up and destroys the first platform. On destruction, the respawn zone of the player is set to the next spot in the array of platforms.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LavaControls : MonoBehaviour
{
public GameObject player;
public PlayerMovement pMove;

public GameObject[] spaceSpots;
private int index = 0;
// Start is called before the first frame update
void Start()
{
    pMove = player.GetComponent<PlayerMovement>();
}

// Update is called once per frame
void Update()
{
    
}

void OnCollisionStay(Collision collision)
{
    if(collision.gameObject.tag == "Player")
    {
        pMove.damagePlayer(1);
    }
    
    if(collision.gameObject.tag == "Platform")
    {
        Debug.Log("destroy");
        Destroy(collision.gameObject);
        index++;
        pMove.safeSpot = spaceSpots[index].transform.position;
    }
}

}

I figured out the collision. I re-added the rigidbody component to each of the platforms. Then I switched from OnCollisionStay to OnCollisionEnter. So now the method looks like this.

void OnCollisionEnter(Collision collision)
{

    if (collision.gameObject.tag == "Platform")
    {
        Destroy(collision.collider.gameObject);
        index++;
        pMove.safeSpot = spaceSpots[index].transform.position;
        Debug.Log(index);
    }
}

Yes my friend … Or u could have declared player on awake too … Not sure but i think would have worked … With collision enter of course … If anyone sees and thinks im wrong i wanna know …:wink: