Hit VFX appears inside enemy and is not visible

Just in case anyone ran into this issue.

If your enemy is large and your ‘Hit’ effect is small, the effect will appear inside the enemy and you won’t see it. And you might think it isn’t working.

You could make your effect bigger, but I solved this by finding the actual location of the hit instead the enemy location (which is the center of the enemy).

Before I get into my solution:
This is a bit complicated (I’m a programmer). But if it doesn’t make any sense, the one thing you can get out of this is: If you can’t see your ship being hit, try shrinking your enemy to make sure the particle effect isn’t Hidden inside the enemy.

The particle system actually returns a ‘list’ of events, but since this game doesn’t need to be exact, I just always take the first event and use its ‘intersection’ as the location of the hit.

Just always make sure your list has at least one item before you take the value from location 0 (the first item in the list): lstCollisionEvents[0]
That’s why I do this check: if( nNumParticleCollisions > 0)

The effect is a little nicer as well.

7 Likes

Thanks a lot for your help! I was wondering why it’s not working^^

Thank you!!

Oh thats neat, thanks for sharing!

Hey, almost a year later but I’d like to thank you for this, I was going nuts trying to figure out how to do it myself. Now I’ve learned how to use this for future projects, it will prove invaluable for me, so thanks again

Privacy & Terms