using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class randomspawner : MonoBehaviour {
public int spawnRadius = 30;
public int agentRadius = 5;
public GameObject agent;
Vector3 originPoint;
void CreateGroup()
{
GameObject enemy = GetRandomSpawnPoint();
originPoint = enemy.gameObject.transform.position;
for (int i = 0; i < groupSize; i++)
{
CreateAgent();
}
}
public void CreateAgent2()
{
float directionFacing = Random.Range(0f, 360f);
Instantiate(agent, originPoint, Quaternion.Euler(new Vector3(0f, directionFacing, 0f)));
}
public void CreateAgent3()
{
float directionFacing = Random.Range(0f, 360f);
Vector3 point = (Random.insideUnitSphere * spawnRadius) + originPoint;
Instantiate(agent, point, Quaternion.Euler(new Vector3(0f, directionFacing, 0f)));
}
}
the errors are
Assets\random spawner.cs(15,24): error CS0103: The name 'GetRandomSpawnPoint' does not exist in the current context
Assets\random spawner.cs(18,25): error CS0103: The name 'groupSize' does not exist in the current context
Assets\random spawner.cs(20,9): error CS0103: The name 'CreateAgent' does not exist in the current context
What I have tried:
i have tried to make empty game objects of these but they still dont work and im all out of options