1
Fork 0
mirror of https://github.com/Steffo99/beat-td.git synced 2024-11-29 18:34:19 +00:00
beat-td/Assets/Scripts/SnareCollision.cs

24 lines
485 B
C#
Raw Normal View History

2018-04-23 11:50:24 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SnareCollision : MonoBehaviour {
public int damage;
public float maxRange;
public float speed;
private float distance = 0;
private void Update()
{
if(distance >= maxRange)
{
Destroy(gameObject);
}
distance += speed * Time.deltaTime;
transform.Translate(Vector3.down * speed * Time.deltaTime);
}
}