- Home /
2D Player Spawn Issue
I have a problem with a script where I have a spawn point set using a sphere(called "spawn") and the script to spawn the sphere(called "skydiver") when the input is active. Right now I can spawn objects in but they don't have the properties of the object I want to spawn in. I also need to set it so that once one "skydiver" is spawned no more can spawn while the input is active. I just need the player to spawn with the properties of the prefab I made for it. This is my second project in Unity and I look forward to expanding my understanding of it. Thank you in advance for your advice.
#pragma strict
var skydiver : KeyCode;
function Update () {
var SpawnPoint : Transform;
if(Input.GetKey(skydiver))
{
var skydiver = GameObject("skydiver");
GameObject.Find("spawnpoint");
}
}
My player is labeled "skydiver" and it is a .prefab file that is not found in the Hierarchy.
My spawnpoint is labeled "spawn" and it is a sphere found in the Hierarchy.
I am relatively new to Unity, this is my second build. Thank you in advance!
Your answer
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
player spawning 0 Answers
character moving after moving 0 Answers
Enter/exit buildings spawn 2 Answers
How to make a game with never ending waves of zombies like in COD zombies? 0 Answers