So this what i’m working with at the moment.
public class FallingPlatform : MonoBehaviour
{
bool isFalling = false;
float downSpeed = 0;
public float interval;
void OnTriggerEnter(Collider collider)
{
if (collider.gameObject.tag == “Player”)
Debug.Log(“Hello”);
if (interval >= 0)
{
interval -= Time.deltaTime;
isFalling = true;
}
}
void Update()
{
if (isFalling)
{
downSpeed += Time.deltaTime/20;
Debug.Log(“Am I working?”);
transform.position = new Vector3(transform.position.x,
transform.position.y - downSpeed,
transform.position.z);
}
}
}
I want to have a timer to activate once the player has collided with the platform. Once the timer ends, it will drop the platform and the player wont be able to use it again.
With what I currently have, when the player enters the collides with the platform, only a small amount of the interval is taken out, it inst continuously going down