x


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?

more ▼

asked Aug 01 '12 at 05:21 AM

Major gravatar image

Major
63 4 11 16

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Aug 01 '12 at 05:28 AM

DaveA gravatar image

DaveA
26.8k 153 171 257

exactly how would i do this?

Aug 01 '12 at 05:38 PM Major

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?

Aug 02 '12 at 01:42 AM DaveA

I am using shruiken.

Aug 08 '12 at 11:47 PM Major

Its fine i'll just use a puff instead. I think the problem it with the shruiken it self. I think it might need a little more work. :)

Aug 10 '12 at 05:36 PM Major
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x453
x335
x209
x163
x24

asked: Aug 01 '12 at 05:21 AM

Seen: 294 times

Last Updated: Aug 10 '12 at 05:36 PM