31 lines
589 B
C#
Raw Normal View History

2025-01-17 13:10:20 +01:00
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
public class fusee : MonoBehaviour
{
public GameObject self;
public float lifetime;
private void OnTriggerEnter(Collider other)
{
if (other.tag != "Player" && other.tag != "Platform" && other.tag != "Finish")
{
Destroy(other.gameObject);
Destroy(self);
}
}
private void FixedUpdate()
{
this.lifetime -= 1;
if (this.lifetime < 0)
{
Destroy(self);
}
}
}