[ANDRÉ] In this video, we're prototyping a 2D game mechanic
and creating two types of magic spells:
a fireball effect and the ability to raise the ground level.
Welcome to the Prototype Series,
a group of videos in which we explore creating small projects,
combining different Unity features.
We'll show you a quick overview of how this project was done
and we also have a longer tutorial for this project
in our Unity Learn website,
which is linked in the description of this video.
We will separate the creation process
by talking about the Assets that we use to start prototyping,
how we use Unity's new 2D tools,
and how we enhance the project's visuals.
Let's get into it.
Usually, when prototyping, it is a good idea to use a project
as a foundation for implementing new mechanics.
In this case, we decided to download Unity's
on the Asset Store.
Once we have the Assets in place,
we started analyzing how to make the character's arm move
relative to the mouse position.
Since this character was made using the new
2D Animation Rigging system,
it was possible to take advantage of the bone structure
to make the arm move.
By using three lines of code,
we made it so that the arm parent bone
rotated towards the mouse position.
Then we made it so that every time
there was a mouse input from the player,
the hand bone would move and rotate to create a spell cast animation.
For the first spell, we decided to create a simple fireball projectile
that would take advantage of the new 2D Lighting system
to illuminate the Scene while moving.
This was a point light with a red color, some intensity,
and also with the Use Normal Map property activated
to have the light interact with all Sprites normal map textures.
We then added the ghost from the
as enemies in our prototype.
For their reaction when being hit,
we expanded the material shader using Shader Graph
by simply interpolating the original color result
with a new HDR color.
With this, we could quickly activate a visual hit state
to then return to the normal color.
For the second spell, we wanted to take advantage
of the new 2D Sprite Shape system.
Sprite Shape gives you the ability to create free-form 2D environments
straight in Unity by moving and placing nodes as you see fit.
The great thing about this feature is that we can access each node
and modify their position by using code.
What we basically did was to check the nearest node
relative to the mouse position,
and then we took that node and interpolated its Y position
from its original height to where the mouse is placed on the screen.
This way, our character could deform the terrain
and even jump on top of the new shape.
We even decided that if the enemy was touched by the spell,
it would be eliminated immediately.
Of course, we wanted to make all of these actions
feel more powerful and have a more striking visual.
For this, we added Particle Systems as a trail for the Fireball.
And we also added three additional Particle Systems
for the earth-bending spell,
composed by a smoke effect, some spark, and a grass burst
to really indicate that the earth was being deformed.
♪ [MUSIC] ♪
To enhance these spells even more,
we made the Camera shake by generating impulse
in our Cinemachine Camera.
♪ [MUSIC] ♪
And as a last touch, we added some UI to indicate
which spell is activated according to the mouse input.
As you can see, prototyping this project
was made a ton easier with the new Unity 2D tools.
There's a lot that can be done using these features,
and we can't wait to see what you can all come up with
by using them.
If you want to try out this prototype yourself
to learn even more, you can download it right now
by following the link in the description.
Not only that, but we also have a link for a longer training session
showcasing the features used to build this on Unity Learn.
Thanks for watching, and I'll see you in the next one.
♪ [MUSIC] ♪