Welcome back.
So now that we have our passive abilities, it's time for some more offensive spells.
I'd like to make use of our arcane damage type.
I'd like to make a new ability that uses this, and here is a really nice Niagara system I'd like to
use for this.
Now this looks the best.
If you go to window and preview scene settings and show the floor, as this is meant to be spawned on
a floor.
So yes, there are parts of it beneath the floor, but it's meant to be spawned on a flat surface or
an angled surface, as long as it's oriented correctly on that surface.
Now, this effects system is pretty nice because it has several components to it.
We can zoom in on the emitters and click on isolate in order to just see one emitter at a time.
Now there's always one large crystal being spawned here.
And if we click on isolation for shards small, we'll see that there's several smaller shards.
And if we go to the right, we'll see that there are even smaller shards that get spawned out randomly
in a torus shape.
And then, of course, there's debris, which are little shards of arcane crystals, and all together
they make up this effect.
And those debris are actually configured to bounce off of the ground.
If we're using a ground that has some sort of collision hall on it, you'll see that those shards actually
do bounce off of the ground.
So they have some physics properties to them.
I'm going to go ahead and delete that.
So I'd like to make a spell that that summons these shards.
We'll call it arcane shards.
And I think for this spell, we have a unique opportunity to start thinking about magic circles and
how we can use decals to implement magic circles.
Magic circles are circles that appear on the ground based on where your mouse cursor is, usually allowing
you to aim and specifically decide where you'd like to start that ability activation.
And if we go into our assets folder into magic circles, we'll see that we have a texture called Magic
Circle one.
And next to that texture we have a material called Magic Circle one.
And if we set the preview mesh to plane, we can see what it looks like.
It's this magic circle using that texture as the opacity.
And it has a color.
So you could easily change the color and even has a multiply here for overdriving the color.
If you'd like it to glow even more, you can set it to a higher value.
So we have this Magic circle material, and I'd like to use this in a decal.
So I'd like to have an actor that has a decal component, which we can use this material for allowing
us to project this material onto the floor when we're targeting, and getting ready to spawn some arcane
shards for our Arcane Shards ability.
So for that reason, I'm going to create a new actor that has a decal component on it, and I'm going
to go into ability system aura abilities, and we have fire and lightning, but we don't have an arcane
folder.
I'm going to create a new folder called arcane.
We're going to go into that and make a new folder here for our Arcane Shards ability.
I'm going to call it Arcane Shards.
And in here is where we'll have all classes related to Arcane shards, except for perhaps our gameplay
cues, which we're keeping in our centralized gameplay queue.
Notifies folder.
Now.
Arcane shards, as I mentioned, is going to use a decal, and I'd like to make an actor specifically
with a decal component that we can spawn and destroy on demand, so that we're only using this special
actor with a decal component when we need to.
So for that reason, I'm going to make a brand new actor and I'm going to make a C plus plus class for
it.
So I'm going to go into Aura Public and this will just be an actor.
So I'm going to put it in the actor folder, and I'll go ahead and create a new C plus plus class based
on actor.
We'll go ahead and click next.
And I'm going to call this Magic Circle.
So this will be our Magic Circle actor.
So let's go ahead and create the Magic Circle actor.
We'll go ahead and close the editor as well.
Now it's asking if I'd like to apply changes to my material.
I'm going to click no so that it remains unchanged and save.
Now I'm going to close all my tabs and go into my new actor class, which will be in actor and it's
Magic Circle.
Here's the CPP file and here's our header file.
I'm going to go ahead and just clear out all of these comments that I don't care about.
And I'd like to move my tick function up to the public section just under my constructor.
I don't feel like I need a public section down there and in magic circle dot CPP.
Same thing.
We'll go ahead and clear out the comments and we have tick.
We have begin play.
Things are looking good and the only thing our magic circle is going to need for now is a decal component.
And a decal component has the class you decal component.
So I'm going to make a T object pointer of type U decal component.
And I'm going to call this Magic Circle decal.
And I'd like this to be a U property with visible anywhere.
And I'm going to construct this in our magic circle constructor.
I'm going to say magic circle decal equals Createdefaultsubobject using U decal component.
And I'm going to give this the name Magic Circle decal.
Now you decal component is incomplete.
So that means we're going to need to know where to go now.
Writer just happens to give me a link to you decal component in the Unreal Engine documentation, and
we see that the module is an engine and the include is component slash decal component.
So I should be able to just include component slash decal component.
And we have a default scene route component.
And I can take Magic circle decal and call Setup attachment and just attach it to the root component.
And with that, we have our decal component and we can go ahead and create a blueprint based on our
decal component.
So I'm going to compile and launch the editor.
And with that, I can open up what I had before, which was just my Magic Circle material.
Actually, I can close that.
And what I'm going to do is open up Blueprint's ability, system or abilities arcane arcane shards,
and I'll make the blueprint based on my new actor here, as it's related to this class.
So I'm going to create new blueprint class and search for Magic Circle and make my Magic Circle Blueprint.
I'll call this BP underscore Magic Circle.
I can open it up.
And if I zoom out and select Magic Circle decal, we have a decal.
By default it's facing this direction, and decals have a material, a decal material, and I can search
for Magic Circle.
Magic Circle one and I can put that on there.
Now we can't see it, but we can see that material once the decal is projecting on to something.
So if I compile and save and I bring in one of these magic circle actors, I can bring it in right here
and notice that it's showing right there that decal on the wall.
So as you can see, the decal actor is projecting sideways.
It's not projecting from top to bottom.
Now we can rotate this around and you can see that it gets stretched if I rotate it 180 degrees.
Now it's facing the other way.
But of course it's still just showing that circle on the wall and not the floor.
Now this looks pretty cool.
You could just leave it like that.
And now in our level, we have this really cool decal on the wall.
And that can make for some really nice decorations if you want that.
That's actually a pretty cool idea, but I'm going to remove the decal.
The Magic Circle actor I'm actually not going to remove it, but I'd like to move it.
I'd like to move it over here because I want to show this on the ground now because it's projecting
sideways.
It looks really stretched on the ground there.
So our decal itself, since it projects itself sideways, we're going to rotate it here relative to
the root.
I'm going to rotate it by 90 degrees like this so that it's facing this way.
So its x vector.
Its forward vector is facing up.
So really it's on its side now.
And I can go ahead and just take this magic circle and remove it and bring in a new one.
And we'll see that this one is now projecting onto the ground.
This is interesting.
Notice that the geometry on this brick here goes up.
And the decal actually is going up onto that brick.
So it's almost like someone just spray painted onto a stencil here on the ground.
And so decals are actually really nice for that reason.
Now if I press play and I walk onto it, notice that aura is also getting that decal sort of spray painted
onto her body too.
So anything that's within that decal volume is also going to get the decal.
For that reason, I typically like to take the decal and make it a little bit shorter, so I can press
R and move this down so that it's only, you know, yay high.
And.
With that, we can walk on to it and you'll see that only Ora's ankles really are getting that deckle
sort of spray painted on.
And it's the floor here that gets the majority of it, and I kind of like that effect.
Now, decals can act a little funny when you move them.
If you move it, say over here to this pillar or piece of the stair, you'll see that it's kind of going
up the sides of it, and you can't really see it at certain angles.
It also stretches with really, really vertical angles.
And if you move it up, you'll see that it does move up those stairs.
But if you want it to say be painted down the entire length of the stairs, you'd have to go in and
actually increase its size like this, which I'm going to just keep it nice and short.
So anyway, there's our magic circle, and the magic circle is going to be nice and useful for us,
because I'm going to want to show this circle when Ora is casting arcane shards and deciding where those
shards should appear, where to spawn those effects and cause damage.
So my goal is to activate the ability and then pop up with this decal and have it follow my mouse cursor
until I click and confirm.
That's our next step.
So we have some things to do, right?
So this is the beginning of the Arcane Shards.
We have our Magic Circle class.
It's looking great and we'll continue in the next video.
I'll see you soon.