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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Individual Sprite Movement

Discussion in 'Scripting' started by gamecreator333, May 16, 2015.

  1. gamecreator333

    gamecreator333

    Joined:
    May 4, 2015
    Posts:
    21
    Hello Everyone!
    I have question that I have been trying to answer for awhile now. I am making a game where there are many balls moving and the player needs to eat them all.
    Since there are balls moving how do I know which is whihc.
     
    Last edited: Jun 30, 2015
  2. SnakeTheRipper

    SnakeTheRipper

    Joined:
    Dec 31, 2014
    Posts:
    136
    I guess sprites[] are prefabs. If so, you should change them and set a GameObject tag for each one.

    For example, yellow ball prefab will have the tag "Yellow", green ball prefab will have "Green" and so on.
     
  3. gamecreator333

    gamecreator333

    Joined:
    May 4, 2015
    Posts:
    21
    Thanks that is actually what I needed.
    Thanks
     
    Last edited: Jun 30, 2015