Particles on touch (destroy)
Hi guys,
I hope you're all well.
It would make my weekend if someone could help me with this.
Basically, I have a actor (my main actor) who bounces around the screen to collect stars - simple - when the actor touches the star it vanishes, yep, this works fine - now, the thing I'm trying to do is to create a little star burst when the object vanishes (to basically make it look a little nicer, and more rewarding as the game is aimed at young children).
I could do it like this, if the star it touched by the actor, vanish and spawn a animation, however, it would be great if it could trigger a little particle star burst rather than spawning another animation.
I'm sure that I saw a tutorial on here a while back, however I can't seem to find it anywhere, so maybe I'm wrong.
I'm going to see if I can work it out, but if anyone knows a way of making objects vanish (rather than just a destroy) in a fancy way, I would love to know.
As always, thanks again to everyone on the forum and for your constant help.
Cheers,
Chris
I hope you're all well.
It would make my weekend if someone could help me with this.
Basically, I have a actor (my main actor) who bounces around the screen to collect stars - simple - when the actor touches the star it vanishes, yep, this works fine - now, the thing I'm trying to do is to create a little star burst when the object vanishes (to basically make it look a little nicer, and more rewarding as the game is aimed at young children).
I could do it like this, if the star it touched by the actor, vanish and spawn a animation, however, it would be great if it could trigger a little particle star burst rather than spawning another animation.
I'm sure that I saw a tutorial on here a while back, however I can't seem to find it anywhere, so maybe I'm wrong.
I'm going to see if I can work it out, but if anyone knows a way of making objects vanish (rather than just a destroy) in a fancy way, I would love to know.
As always, thanks again to everyone on the forum and for your constant help.
Cheers,
Chris
Comments
Another method for making something disappear:
Use the Interpolate Behavior. In the actor attributes, under the Color section you will see Alpha. You can set it to 0. Set it up so that your animation actor, or actor with a particle emitter attached has a Rule : when it collides with your star, Behavior: Interpolate: self.color.alpha To: 1. That will make it visible. Now this is where your probably want to add a timer in the mix (note: interpolate does have its own duration), for a second or two, before telling the next Interpolate behavior to switch back to 0, making it invisible again.
The tricky things with particle emitters is that they need that little warm up time before their effect does what you need it to. A second or two may not be enough, that why an animation may work better in this instance.
Hope that helps. Just woke up.. so if it does not I'll clarify. Yaaaawnnn... Seeks coffee
Cheers and thank you for taking the time to get back, much appreciated.
I hope you enjoyed your coffee