Obstacle Map Changes

This commit is contained in:
TGall8
2025-03-03 19:03:34 -05:00
parent a3cb9671db
commit 1ccf8d0d5b
3 changed files with 520 additions and 340 deletions

View File

@@ -4,14 +4,17 @@ using UnityEngine;
public class FallPlatform : MonoBehaviour
{
public float fallDelay = 2f;
public float destroyDelay = 2f;
public float resetDelay = 2f;
bool falling;
Rigidbody2D rb;
//Vector3 position;
void Start()
{
rb = transform.parent.GetComponent<Rigidbody2D>();
//position = rb.transform.position;
}
private void OnTriggerEnter2D(Collider2D collision)
{
@@ -26,7 +29,7 @@ public class FallPlatform : MonoBehaviour
falling = true;
yield return new WaitForSeconds(fallDelay);
rb.bodyType = RigidbodyType2D.Dynamic;
yield return new WaitForSeconds(destroyDelay);
Destroy(gameObject);
//yield return new WaitForSeconds(resetDelay);
}
}