Untitled
unknown
csharp
a year ago
426 B
101
Indexable
using UnityEngine;
// This is a simple example of how to spawn an enemy - Gatsby
public class MonsterSpawner : MonoBehaviour
{
public GameObject enemyPrefab;
void Update()
{
if (Input.GetKeyDown(KeyCode.E))
{
SpawnEnemy();
}
}
void SpawnEnemy()
{
Instantiate(enemyPrefab, gameObject.transform.position, Quaternion.identity);
}
}
Editor is loading...
Leave a Comment