Files

31 lines
459 B
C#
Raw Permalink Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObsctaleScript : MonoBehaviour
{
private float deathTime;
private float myTime = 0.0f;
void Start()
{
deathTime = Random.Range(10.0f, 15.0f);
}
// Update is called once per frame
void Update()
{
myTime += Time.deltaTime;
if(myTime > deathTime)
{
Destroy(gameObject);
}
}
}