Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class RandomEnemyV3 : MonoBehaviour
- {
- GameObject[] spawnPoints;
- GameObject currentPoint;
- int index;
- void Start()
- {
- spawnPoints = GameObject.FindGameObjectsWithTag("Enemy");
- index = Random.Range(0, spawnPoints.Length);
- currentPoint = spawnPoints[index];
- print(currentPoint.name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement