Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question 2d Game development

Discussion in 'Editor & General Support' started by Kartik_007, May 29, 2020.

  1. Kartik_007


    May 29, 2020
    how does one spawn multiple sprites from a circular boundary outside the game scene and move it towards the centre of the screen?
  2. You can't do anything "outside of the scene", you meant outside of the viewport? That's possible. You basically just calculate a vector from the center of the scene using an angle.

    But I wouldn't do that because then assuming that the player has a rectangle display (usually people have), then it will spend more time outside of the screen when the sprite comes from above or below than left or right (if the screen is landscape).
    Just span the sprites outside of the viewport and start to move them, the player/viewer would not notice if they come from 5 units away outside of the screen or 1.
    Just try to build the script and when you stuck somewhere post it and we can help fix it, but we won't write it for you, that's your job.
  3. PraetorBlue


    Dec 13, 2012
    Break your problem down into smaller chunks and get each one working individually. Put them together only when each individual piece is working well:
    Start with this:
    Then add that the sprites are spawned in a circle:
    Do this part separately with a single object at first:
    If you can do each of these individually, it should be easy to put them all together!
    Lurking-Ninja likes this.