Advertisement
SizilStank

Untitled

Sep 26th, 2022
1,771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | Gaming | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class EnemyLineMovement : MonoBehaviour
  6. {
  7.  
  8.  
  9.     [SerializeField] private float _enemySpeed;
  10.     [SerializeField] private SpawnOnWayPoints _spawnOnWayPoints;
  11.  
  12.  
  13.     // Start is called before the first frame update
  14.     void Start()
  15.     {
  16.         _spawnOnWayPoints = GameObject.Find("SpawnOnWayPoints").GetComponent<SpawnOnWayPoints>();
  17.     }
  18.  
  19.     // Update is called once per frame
  20.     void Update()
  21.     {
  22.         transform.Translate(Vector3.down * _enemySpeed * Time.deltaTime);
  23.  
  24.         if (transform.position.y <= -9.01)
  25.         {
  26.            
  27.         }
  28.     }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement