Hello Guest

Author Topic: Two Sprites, One GameObject  (Read 4024 times)

c-Row

  • Newbie
  • *
  • Posts: 3
    • View Profile
Two Sprites, One GameObject
« on: October 21, 2013, 12:15:20 pm »
I got a single enemy type as a sprite which I want to separate into two different sprites - one of them should keep all the colours while the other one should change its tint randomly (think "Clash Or Heroes", where parts of similar units have different colours while others don't). However, once I add a second sprite to a GameObject only one of them is visible despite both of them showing up in the game object's atlas material.

Am I missing something here, or is it not possible to add two sprites two a single game object? It would certainly be much more elegant than make each sprite a child of an empty parent game object.
« Last Edit: October 21, 2013, 12:17:21 pm by c-Row »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Two Sprites, One GameObject
« Reply #1 on: October 21, 2013, 12:24:00 pm »
No it isn't possible to attach 2sprites to a gameobject. A sprite requires a Renderer & MeshFilter, and you can have only one of them per gameObject.

c-Row

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Two Sprites, One GameObject
« Reply #2 on: October 21, 2013, 12:26:12 pm »
Ah, I see. Two separate GameObjects it is, then.

Thanks!   :)