- Home /
spawning problem
I can't seam to get this script to work for spawning an enemy.
var evilsphere : Transform;
function Update () { Instantiate (evilsphere,transform.Find("spawnpoint")transform.position, Quaternion.identity); }
Also I would like the enemy to be spawned randomly, how should I do that?
Answer by StephanK · Jul 15, 2010 at 09:48 PM
If this is your script you probably get a syntax error because you're missing a dot between ("spawnpoint") and transform.position. Also instead of searching for the object named spawnpoint it would be a good idea to save a reference to the spawnpoint. (like you did for the prefab)
If you want to spawn at random position look into Random.insideUnitCircle.
Your answer
Follow this Question
Related Questions
how instantiate random enemy only once on random spawn 1 Answer
Random Position Script 1 Answer
Creating a light in game C# 1 Answer
Randomly Initiate Cubes - Prevent Same Position 0 Answers
Room generator spawn 1 unique room 1 Answer