Hello Guest

Author Topic: Make (animated) sprite invisible?  (Read 3554 times)

Napoleon

  • Newbie
  • *
  • Posts: 2
    • View Profile
Make (animated) sprite invisible?
« on: June 27, 2015, 03:27:39 pm »
I can change the z-axis to somewhere behind the 2D scene. But what is the proper way to do this?

I have a projectile and it hits something, so I disable it's collision and want it to become invisible while the explosion sfx is playing. After that it is automatically destroyed.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Make (animated) sprite invisible?
« Reply #1 on: June 28, 2015, 01:42:14 pm »
You're just mixing behaviours here - the explosion should really be separate to the projectile, but if  you really want to do it this way you can disable the renderer on the object.

Napoleon

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Make (animated) sprite invisible?
« Reply #2 on: June 29, 2015, 12:05:41 pm »
You are right. It's bad design. I should use a separate object for the explosion and clean up the projectile.