Sitemap

Journal 148 — Unity Project Development, 2.5D Shooter

4 min readFeb 12, 2022

Objective: Add destruction and damage effects for 3 enemies

In the previous articles, I have been making refinements to my project. In this article, I will go over how I updated the enemy damage and destruction

Final Boss

For the B-2 stealth bomber final boss, I imported the FBX model over to Blender to make a short destruction animation, where the craft breaks apart and falls.

In Blender, I imported the FBX. In the import settings, include the check box for “image search” to also look for materials.

Press enter or click to view image in full size

Once the model is imported, the materials loaded in correctly, but there is no image texture applied. With the model selected, you can view the Materials tab, and update the base color with the correct image texture.

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

Now, we can switch to the Viewport Shading, which will show the materials and texture applied.

Press enter or click to view image in full size

Now I want to set up the camera view to render an animation. I can pick the X-Y-Z in the upper right of the workspace to change to a side view, same as the view during game play.

Press enter or click to view image in full size

Then with the correct view, you can update the camera view to match.

Press enter or click to view image in full size

In my case, the camera view was set too close to the craft, and also the camera type needs to be checked for perspective and orthographic settings.

Press enter or click to view image in full size
Press enter or click to view image in full size

Now with the correct camera view, I will apply the Blender Quick Effects called Quick Explode.

Press enter or click to view image in full size

Let’s see these results.

Press enter or click to view image in full size

Now, let’s start setting up the animation. During the animation, I need to adjust the camera view slightly to make sure to record the falling debris, so it looks reasonable during game play. Since the whole destruction sequence is less than 50 frames, I’ll just make a few key frames in the Camera tab and Transform tab to widen the camera shot and change the z-position to follow the debris.

Press enter or click to view image in full size

Make sure to confirm the save location, and also confirm the animation is set to transparency.

Press enter or click to view image in full size

Now, let’s see the recorded animation.

Press enter or click to view image in full size

Now to import this into Unity and set each image to Sprite Texture.

Press enter or click to view image in full size

Now I’ll make an empty game object and create the animation. I adjusted the sample rate to make it a bit slower.

Press enter or click to view image in full size

Damage Effect

For the damage effect, I used a fire particle effect.

Press enter or click to view image in full size

I added a new empty game object to the enemy craft and I will enable this after the enemy is hit by a certain number of shots.

Press enter or click to view image in full size

In the Enemy base script, I will set the damage particle effect active in the OnTriggerEnter function.

Then, when the enemy is destroyed, I will turn off the enemy craft collider and mesh renderer and instantiate the destroyed animation in its place.

Press enter or click to view image in full size

Finally, let’s see this in action.

I have a few more major updates planned over the next few days. Thank you for your time!

--

--

Chris Nielsen
Chris Nielsen

Written by Chris Nielsen

An Engineering Manager consultant who is seeking additional skills using Unity 3D for game and application development.

No responses yet