Meta

Appear and disappear effect in WaveEngine

In this article, I’m going to show how to create a cool effect to make the NPCs in your game appear or disappear. One of the issues that you need to resolve when you kill an enemy in your game is how to hide it from your scene. Unless, of course, you want to pile up enemy bodies.

We are going to create a custom shader in WaveEngine for our aim. If you do not already know it, we recommend reading this article before you start.

Follow the steps to create the project effect.

Create project

Start Wave Visual Editor and choose File ->New project

Set a name and folder location for your game:

Now we have a new DisappearEffect project with the default template. Download the assets zip and add them to the Assets project.

After moving assets to the Assets/Models folder, drag the teapot model to the viewport to create a teapot at the origin coordinates:

Set the entity name to teapot. This is the name that we will use to find the entity in the EntityManager.

This teapot mesh has been edited in 3DStudioMax to add 2 different texture coordinates that we will use later.

Create a custom shader

We are going to create a Custom shader from VisualStudio. Click on File -> Open C# Solution to open the DisappearEffect code project.

In VisualStudio, you can see the code project on Solution Explorer

Create a DisappearMaterial.fx file below the following folder hierarchy

Published by

Jorge Canton

He is an engineer in computer science, #WaveEngine team member is a technology enthusiast determined to stay on the cutting edge of development. He is a very dynamic person who loves solving challenges, puzzles and riddles. He usually spends his free time with his family or playing videogames on his console or mobile phone and plays the piano to relax.
View all posts by Jorge Canton