Advertisement
crystalguy123

Untitled

Jan 24th, 2020
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Lazer : MonoBehaviour
  6. {
  7. [SerializeField]
  8. private float _speed = 8f;
  9.  
  10. void Update()
  11. {
  12. transform.Translate(Vector3.up * _speed * Time.deltaTime);
  13.  
  14. if(transform.position.y > 8f)
  15. {
  16.  
  17. Destroy(this.gameObject);
  18.  
  19. }
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement