- Home /
Spawn Explosions Horizontally
Hi im making a 2d/3d td. ive made it so that the enemies follow waypoints, but when i kill the enemy they just dissaper. i added a blood particle effect. but it only works if it spawns horizonaly. but when i destroy my enemy it dosn't spawn horizontally. it spawns where the object that destroyed it hit it. so my question is, how do i spawn an explosion that spawn horizontaly, and directly in the center of my enemy?
Answer by DaveA · Aug 01, 2012 at 05:28 AM
You could attach the particle emitter to the center of your enemy prefab, normally turned off. When he's hit, turn it on. Set the velocity vector on X and/or Z but zero on Y.
You must have an enemy prefab, am I right? If so, you just add the particle emitter to that prefab, and set it to NOT emit. But while you're editing, make sure the velocity is, say, 0,0,1 to spurt in the Z direction. Then turn emit off. Now your enemies will walk around with this inactive particle emitter. When you detect they've been hit, you get the enemy's particle emitter component, and set emit to true. Are you using legacy or shuriken particles?
Its fine i'll just use a puff ins$$anonymous$$d. I think the problem it with the shruiken it self. I think it might need a little more work. :)
Your answer
Follow this Question
Related Questions
Adding a Material to Particle System 1 Answer
Making a Shuriken Particle System Turn on and off. 1 Answer
Slow Particle Down Inside Collider 1 Answer
Spawning an explosion using an IF statment 1 Answer
Access newly created particles 0 Answers