Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

how to spawn an object with Instantiate and rotate every object that spawns

Discussion in '2D' started by gameMaker1006, Mar 17, 2020.

  1. gameMaker1006

    gameMaker1006

    Joined:
    Mar 15, 2020
    Posts:
    6
    I dont know how to do it.
    Can you help me?
     
  2. dreamCirno

    dreamCirno

    Joined:
    May 16, 2018
    Posts:
    20
    I think you can instantiate a prefeb gameobject.
    But the prefeb gameobject has a self-rotate script.
    Last, once you instantiate the prefeb gameobject. It will rotate automatically.
     
  3. gameMaker1006

    gameMaker1006

    Joined:
    Mar 15, 2020
    Posts:
    6
  4. gameMaker1006

    gameMaker1006

    Joined:
    Mar 15, 2020
    Posts:
    6
    but i just need it to rotate once right after it spawns
     
  5. dreamCirno

    dreamCirno

    Joined:
    May 16, 2018
    Posts:
    20
    Easy and fast, can you use Animation and Animator?
    Give the prefeb gameobject a animator,create a rotate animation.
    Be careful, you need uncheck the animation loop.
    Then when you instantiate the prefeb gameobject, it will automatically play the rotate animation.
     
  6. gameMaker1006

    gameMaker1006

    Joined:
    Mar 15, 2020
    Posts:
    6
    i don't know how to do all of those things i just started a week ago
     
  7. dreamCirno

    dreamCirno

    Joined:
    May 16, 2018
    Posts:
    20
    You have better follow the tutorial video. step by step. To understand each step.
     
  8. gameMaker1006

    gameMaker1006

    Joined:
    Mar 15, 2020
    Posts:
    6
    what tutorial video?
     
  9. dreamCirno

    dreamCirno

    Joined:
    May 16, 2018
    Posts:
    20
    Unity 2D Tutorial Video.
    If your native language is English, that's great, you can check out the official Unity Tutorial or search Unity 2D Tutorial on Youtube
     
  10. gameMaker1006

    gameMaker1006

    Joined:
    Mar 15, 2020
    Posts:
    6
    thanks a lot