Skip to content

Instantly share code, notes, and snippets.

@ZeroCool5254
Created March 19, 2021 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZeroCool5254/c684260ea52a4130fc03804b3cb9f36a to your computer and use it in GitHub Desktop.
Save ZeroCool5254/c684260ea52a4130fc03804b3cb9f36a to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Laser : MonoBehaviour
{
[SerializeField]
private float _speed = 8.0f;
void Update()
{
transform.Translate(Vector3.up * _speed * Time.deltaTime);
if (transform.position.y >= 7)
{
Destroy(this.gameObject);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment