A step vanishes when you step off it?

I’m tryng to make a stop that vanishes (destoys) when you step off it. When you stop on it nothing happens, but when you step off it it disappears so the player won’t be able to reuse it.

I made a script for the step to be times for 3 sec after u stop on it, but it didn’t work without the step being effected by gravity or being “isTrigger”.

I need the step to float in empty-space and when the player steps on it nothing happens, but when he/she stops off it it vanshies.

Thanks!!

Here is something that works. I have a player object with a rigidbody and collider. I have steps with rigidbodies that use no gravity and are kinematic and a collider.

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


// Simple player mover that just moves it forward so i can move down steps
public class PlayerController : MonoBehaviour
{
    Rigidbody rb;


    private void Awake()
    {
        rb = GetComponent<Rigidbody>();
    }


    private void Update()
    {
        if (Input.GetKey(KeyCode.RightArrow))
        {
            rb.MovePosition(transform.position + transform.forward * Time.deltaTime * 1f);
        }
    }
}

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


//This is placed on your steps
public class StepController : MonoBehaviour
{
    bool isPlayerOn;


    private void OnCollisionEnter(Collision collision)
    {
        // Is it a player - using markup (this makes sure other things doesn't hit the step and turn it off
        PlayerController player = collision.gameObject.GetComponent<PlayerController>();
        if (player)
        {
            isPlayerOn = true;
        }
    }


    private void OnCollisionExit(Collision collision)
    {
        if (isPlayerOn)
        {
            gameObject.SetActive(false);
            isPlayerOn = false;
        }
    }
}


Worked fine for me, hopefully it gives you some idea of doing it.