Hey Guys,
I'm trying to build something fairly simple. I have a band with players. And when you click (or tap) on a bandmember, a loop will start playing. And if you click (or tap) the same bandmember the loop will stop. In reality, I want this loop to keep playing, but just change the volumes. So far I have part of it working but I run into a weird problem..
My 3rd solution so far:
I tried lots of things and I thought maybe clicking on the same sprite is gonna cause problems. So I now made 2 sprites. SpriteA (volume up) and SpriteB (volume down).
As soon as you start the scene, SpriteA is created and the volume is set to -100. When you now click on SpriteA, the volume will go to 25. In the same click SpriteA will be destroyed after clicking, and SpriteB will be created in the same location.
The idea was that, if you now click on SpriteB, the volume will go back to -100. SpriteB will get destroyed. And SpriteA will be loaded in the same spot again.
This is very clunky I realize that, but the logic not working. Made me desperate, and it brought me here eventually I guess hahah. I even tried to create the sprites on different layers but the effect was the same.
What I discovered:
This solution does not work, I can provide a screenshot as well. BUT... if I let SpriteB to be created on a different location on the screen. So not where SpriteA was. THEN IT WORKS !!!
But if I have both sprites in the same location, nothing happens. SpriteA does not get destroyed, it just gets recreated again (the sprite animation starts over at least). No sound volume gets changed, and SpriteB will not be created.
So if I create SpriteB 200 pixels to the left. Everything works fine!
Is this a bug or am I just being an idiot? I mean, it happens every now and then so I wouldn't be surprised. But I hope someone could maybe help me with this.