Untitled
Anonymous
csharp
11/29/2024 5:07 PM
568 B
154
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