Welcome back.
Now, in this video, we're going to be adding some juice.
What does that mean?
Well, if we have our shaman summon some minions, they all just pop in, and that's boring.
It doesn't really look all that great.
Now, what do games do to make this look better?
Well, all kinds of things.
You can use some particle effects.
We're doing that here.
But we could spawn in more effects, have them come in with a poof of smoke or something like that.
Another thing is they could use animations.
They might have a summon animation, maybe for skeletons.
They crawl up out of the ground, things like that.
But what if you do?
If you don't have any of those?
What if you don't have animation skills or an animator?
You don't have the money to spend on a nice particle system?
Well, there's other ways to add what we call juice.
Juice is what makes a game juicy.
What makes it more fun?
What makes it look more attractive?
How can we make them pop in in a more attractive manner?
Now, one way to really easily add juice and it doesn't cost anything is by Tweening.
Tweening is kind of a name for interpolation or interpolation like behavior.
Let's close some of our tabs and we'll see exactly what we mean by Tweening I'm going to go into Blueprints
character and just open our enemy base and I'm going to do something and begin play.
So looks like Begin Play is right here.
I'm going to drag it on up and just because I don't like these other grayed out nodes, I'm going to
delete them.
And what are we going to do for begin play?
We're going to do some tweening.
Now Tweening is taking two values and getting a value in between both of them.
In other words, it's an interpolation tactic, but we use the term a little bit more broadly than that
rather than just using it for interpolation.
We can use timelines and curves and all kinds of cool stuff.
I'm going to make a timeline, so I'm going to right click type timeline, scroll down and choose add
timeline.
We're going to call this spawn timeline and in Begin play, we're going to play it and we can double
click the timeline to add a track.
I'm going to add a float track and call this scale track because I'd like to add a curve here that we
can use to scale our character.
So I'm going to right click and add a key and at time zero, I'm going to set the value to zero.
And what I'd like to do is use this curve to scale our character, make it pop out, but I'd like it
to sort of bounce a little bit.
Kind of wobble.
That's the juice I'm talking about.
So what I'll do is I'll add another key and this will be at time 0.1.
So fairly quick.
And I'm going to select both of these keys, right click and Choose Auto.
And that way we have handles on them when we click on them and we can shape the curve.
If I click on this handle and angle it upward and click on this handle and angle it upward, look at
that.
Now our curve goes up like this, and I want it to go up to just above one as a scale of one is just
the regular scale for our characters.
So I'm going to make these go up quite high and I'm going to zoom to fit vertical.
And I can see that I'm about 1.5 here.
That's about how high I want to go, about 1.5.
And this is quite fast.
So here at time 1.5, our scale is going to go way up and way back down.
Now, I want an undershoot.
I want it to kind of wobble here.
I'm also going to zoom to fit horizontal so we can see this curve and control it a little bit easier
here.
So I want it to be something like this.
All the way up to a little over 1.5.
And to get an undershoot, I'm going to add another curve.
So right about here.
This will be at, let's just say 0.2.
And we'll see that we have a nice undershoot there and we can even add another curve over near 0.3 seconds.
Make sure that's an auto curve and then we can make this have a bit of an overshoot.
Like.
So I'm going to go ahead and zoom to fit on both dimensions.
And now we have this kind of wobble.
Now we can use this curve to set the scale of our enemy.
So what we'll do is back to the event graph.
We'll take this timeline and we'll take our scale track and we're going to make a vector out of it.
So we're going to drag off type make vector.
And we're going to use the scale for X, Y and Z of the vector and use this vector to set the scale
of our mesh.
We're going to drag out, take our mesh and call set relative scale 3D.
Like that.
And on update, we'll use that curve value.
Now at the end of the curve, we should end up at a scale of one, right?
So what we should actually do is take these points, not the first one, but all these other ones,
and move them up so that they end up centering on one.
So I'm going to drag them up like this and I'm going to click on the last one and make sure that its
value is exactly one.
So that way we'll go up to about two, but we don't have to overshoot quite that high.
I'd like to overshoot to about 1.5, 1.6 or so, and we'll have an overshoot undershoot and then settle
back in on one.
And that way, by the end of the timeline, we're at a scale of one.
Okay?
Now we can just test this out.
So we're going to press play.
Now, it did happen there, but there we go.
It's happening for our enemies as they spawn in.
Yes, it happens for our shaman at the very beginning, but that's okay.
Now this overshoot is a little bit extreme, so we can always tweak it.
I'm going to open that timeline and we're going to make this overshoot just a little bit less extreme.
Let's go to perhaps.
This amount and a little bit less actually.
We'll leave that undershoot extreme like that.
Let's see how this looks.
That's better.
The undershoot could be a little less extreme, too.
So we'll just tweak this.
Let's zoom to fit horizontal there.
And I like to sometimes make this area smaller, so it's a little easier to see the difference here.
That is a little bit better.
So we'll make this settle in at one right there at the end.
Yeah, that's looking pretty good.
Excellent.
And if you really wanted to, you could have different tracks for different dimensions.
This could be for the Z scale.
We could also have a different track for X and Y.
So we have a scale track, right?
This could be scale track Z, and then we could have a scale track horizontally if we wanted to poof
out a little fatter and it'll look a little bit less like we're scaling upward.
Also, we're scaling up from the origin of the actor as well.
But we got tweening and now our summoning is a little bit more juicy.
That looks great.
So excellent job.
I'll see you in the next video.