Thruster VFX

Daniele Quero, PhD
3 min readJul 21, 2021

Objective: Improve immersion by adding a thruster VFX

We are going to add some VFX from now on. In this tutorial I’m adding a thruster, which will be an animated sprite child to the player.

As usual I will add some feature so we can learn something new.

First I create a new child sprite and animate it as usual. But I think the something more can be done: if you remember, we have a power up which increases player speed, so what if the thruster also gets bigger, and then turn normal again? Cool, no?

On the sprite renderer component of the object, let’s adjust the sorting and select Pivot as Sprite Sorting Point.

Then, if we click on one of the sprite from the project view, we will have a view of sprite settings, such as pivot position, click on the sprite editor. The little blue circle is the pivot, let’s move it to what we should consider the origin of the thruster. Consider position readjustment after this operation.

Basically the pivot is the point, in the sprite or object that should be considered as position, when it comes to transform.

You can visualize the pivot as the anchorage to the space.

Unfortunately, this pivot change has to be done for all animation frames/sprites, but don’t worry, once you choose the first pivot you just have to copy paste their values.

The reason why we had to do this hard work is that when we rescale an object, it will occupy a different portion of space than before — of course — but the pivot will maintain its position! It’s just what we need for our VFX on collecting the speed power up.

The code part is very simple, we just have to modify a bit what happens when the player collects the power up.

Simply we rescale and rescale back after cooldown.

Let’s look at the final result.

--

--

Daniele Quero, PhD

A professional developer with passion for game developing and skill-growing. A former Nuclear Physics Researcher who changed his life to pursue his dreams