top of page
Search

Object Spawning Challenge #1

  • Writer: Keshav Batra
    Keshav Batra
  • Jun 17, 2022
  • 1 min read

I've decided to try and work on my coding skills with these coding challenges that have been given to me. That way when I get a job in the industry, I won't forget how to code. In this case I've had to program objects to spawn whenever I press a button. I was able to clone the objects whenever I push the K key using instantiate. My next challenge will be for the objects to spawn in front of the player.





{
    public GameObject Sphere;
    Transform Y;
    Transform X;
    // Update is called once per frame
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.K))
        {
            Instantiate(Sphere);
        }
    }
}

 
 
 

Comments


bottom of page