How do I play a particle effect in the game?
by Robert Carroll · in Torque Game Builder · 10/26/2009 (2:32 am) · 3 replies
Hi, this is my first time working with particle effects in scripts. I got a platformer that has a gun(s) I got the changing down but when I shoot it shoots the bullet but with no flash, makes it look less fun. Is there a way I could mount a gun flash behavior to the gun barrle then have it play when I click and stop when I let go. An anamation would be better (kickback) but I have no clue on how to do that with 10+ guns.
About the author
Stay Up all night playing PS3 ;) add me PSN: RCBASEBALL13.
#2
10/26/2009 (2:38 pm)
so is this like using sound alxplay(particleffect)? I was thinking about mounting it to my gun so when I click it it plays that particle effect. What do you mena by hiding it and reappering it? move toward behaviors?
#3
10/26/2009 (2:47 pm)
What if I make a play particle effect on mouse down behavior, and have it play a non-cycle particle effect. So that it plays it, then I don't have to worry about the stoping it since its not cycled.
Associate William Lee Sims
Machine Code Games
A really easy way to do this would be to create the particle effect in the engine, just outside of the range of your game world. When the fire behavior starts, just attach the effect to your gun's location. (I'm assuming a machine gun from your previous posts.) When the player stops firing, just move the particle back to the distant location.
It's not quite how I would do it, and there are optimizations you could make to this, but this will get you moving.