Web developer from Derbyshire, UK.

Report RSS Today I have been creating helpers for explosions

Posted by on

Maybe I should come clean about the project I'm creating. It's a silly, stupid game that I thought would be funny a long time ago, before I realised I'd spend so much time looking at it and getting sick of it.

The game I'm making is one where you fight a giant turd.

Yes that's right. A turd.

A turd in space.

A space turd.

Okay glad that's over with. Remember this is just a silly project that I'm using to learn about Unity, so it's not meant to be taken seriously.

There's also a storyline about a space pilot with the crappiest job in the galaxy - get it? No of course you don't because you stopped reading because this is stupid.

Okay so now that's out of the way, here's what I've been doing today. When the enemy (the turd) is destroyed, it will sit there and explode. Gross right? Well it won't be that gross because I can't be arsed to create a gross particle explosion, I'm just using the normal one that came from one of the Unity tutorials.

I really wanted to to sit there and show the explosion a few times, with explosions moving up and down the big long poop. I figured out the hard way that's actually hard to do, because of instantiating the explosion inside the object (took me some time to figure out how to do that) and then realising that positioning the explosion relative to the parent is really hard (or I'm doing it wrong, probably that).

So what I did instead was create 6 dummy objects to use as positions for the explosions. Simple really, probably should have done that to start with. Although the code I've written is terrible and has a lot of repitition (I prefer it to be DRY). Finding an elegant solution always takes longer.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: