hello there, that my Ram isn’t Spawning when i run the game, here is my code →
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectPool : MonoBehaviour
{
[SerializeField] GameObject enemyPrefab;
[SerializeField] float spawnTimer = 1f;
void Start()
{
StartCoroutine(SpawnEnemy());
}
IEnumerator SpawnEnemy()
{
while(true)
{
Instantiate(enemyPrefab, transform);
yield return new WaitForSeconds(spawnTimer);
}
}
}
The script is placed inside the ObjectPool GameObject and the Ram is also in the SerializeField, i can provide more detail if needed.