hey everyone welcome back so in the
previous video we were working inside of
the construction script inside of our
light blueprint and we set it up so that
we could have uh a little bit of
variance uh on each of our individual
instances of our light blueprint so
quick quickly recapping here if we go
and play in the editor here we can walk
up to this light and press F to turn it
on and notice that the light's green and
our light on the back side even though
it's the same blueprint uh that
particular light has a blue light
attached to it and it was on by default
but we could still turn it on or off uh
like so so that's what we did in the
previous video uh we set up our
construction script to allow a little
bit more flexibility with how uh this
blueprint functions uh what we're going
to do in this video uh is still work
with blueprint classes uh but we're
going to do it in a different way we're
going to take a brand new uh approach to
building our blueprint class it's just a
different workflow uh so recapping our
previous workflow what we've done is
inside of our content browser down here
we've right-clicked we've created a
blueprint class we've picked our
blueprint uh our parent uh class to use
which was the actor and once we've
created our blueprint class uh we've had
the ability to add components so we've
added several components to make up our
blueprint once we were happy with all of
our components we hopped over to the
event graph provided the script for how
our blueprint is going to function and
customized it on the the construction
script uh but what we're going to do now
is a little bit different so let's close
this what we're going to do here is
we're going to build out our blueprint
class inside the level here so we're
going to make a brand new blueprint
class inside of the level here and add
all the components and everything we
need inside the level here uh and then
turn it into a blueprint that we can
then modify and add script to so let's
go ahead and do that so uh what we're
gonna do we're hop to the other side of
our little building here and over in the
modes panel under the basics tab uh
notice there's an empty actor let's go
and select this empty actor here we're
going to left click and drag that into
our level and just place it somewhere on
the floor like so let's go into to
translation mode so we can kind of move
it around a little bit somewhere in the
center like so and now with our empty
actor selected if we hop over to the
details panel for it notice we have the
ability to add components here as well
so we can add new components to this
actor now notice this is an actor this
is currently not a blueprint we have no
ability to add script to it just yet
however if we turn it into a blueprint
uh then we can add additional script to
it so what we're going to do we're going
to add some components to this we're
going to make a bush on the side of our
building here uh that whenever the
player enters a trigger volume uh
catches the Bush on fire because that's
fun burning things is is fun not to
sound like a pyromaniac here but that's
what we're going to do uh let's go ahead
and add some components to our actor
here so let's add a component well
actually let's not let's not click the
add component we're going to do a couple
different ways of of adding components
here so uh let's actually go down to the
content browser let's go to the props
folder inside of the starter content uh
there's an SM Bush inside of the content
starter content and props folder let's
take our SM Bush and you may be inclined
to drag it into the level and build
around it but we're going to drag it
into our empty actor here so when we do
so that's going to add it as a component
to our empty actor now since our empty
actor is no longer empty uh first of all
let's rename our Bush to well I guess SM
bush is a good name we'll leave it as SM
Bush uh since our actor is no longer
empty we're going to get rid of this
default scene route just as we did
before with our light fixture we're
going to take this SM Bush here left
click and drag it on top of the default
scene route that's going to make our
Bush the new route and kill that default
uh dummy object
so uh now that we've dragged something
from the content browser into our actor
uh now let's add a component we'll click
the add component button and we want to
add a particle system and a particle
system is what is used uh for particle
effects and our fire is going to be a
particle effect that we want to attach
to this uh this bush here so uh we could
search for it but it's pretty much right
at the top here there's a particle
system that's what we want to select so
go and select that it's going to add a
new particle system we'll rename this
one to we'll name this to fire like
so and with the fire particle system
selected currently we're not seeing
anything in our viewport here uh that's
because we haven't assigned the particle
system to use so down under the particle
section I'll click this none drop down
here and all the particle systems that
came as part of that starter content is
being uh displayed to us here right
there somewhere in the middle there's a
pcore fire go ahead and select that
and that's going to add fire to our Bush
here now we don't want this to be on by
default we're going to add a trigger
volume here in a second that when the
player enters will then turn this on uh
so we're going to scroll all the way
down at the bottom all the way down at
the bottom of this particle system
there's an activation section and it
says uh autoactivate down there at the
bottom uh if I Mouse over it says
whether to whether to the component is
activated at creation or must be
explicitly activated making a mental
note to update this tool tip here uh
we're going to uncheck this because we
don't want to autoactivate this we want
to activate this through blueprint
script so go ahead and uncheck the auto
activate there so I'm uncheck that so it
turns it off inside of our level here
and then the last thing that we need to
add is our box Collision which will
represent our trigger just as we did
with our light fixture so I'm going to
add one more component I'm going to
search for box that's going to give us
our box box Collision so go and select
it and it's asking us for a name we're
going to call it the trigger box like
so now our trigger box inside our level
is super small and super tiny so we're
going to have to scale that up we could
do that right here inside of the level
editor make sure that our trigger box is
selected going to move it up just a
little bit going to press R to go into
scale mode and just scale it along the
uh Y and X here to kind of stretch it
out like so uh we can move it up along
the Z2 I guess and hit W to move it
going to move it out of the wall so it
is not clipping through the wall like so
so there we go uh I think that should be
good when the player enters this volume
we'll catch the Bush on fire so we have
all the components that we need now uh
we can click the blueprint add script
button and that's going to turn all of
these components that we've just uh
added to this actor into a blueprint so
let's go ahead and click this
it's going to ask us to select a
location and a name for this new
blueprint let's go and save ours inside
the blueprint folder uh we're just going
to call this the burning bushore BP
because that seems like an appropriate
name and go ahead and create a blueprint
out of these
components and when we do so the
blueprint editor opens to the viewport
tab there's all of our components
there's our box Collision our fire which
is currently hidden uh and our static
mesh
Bush so we are already already ready to
start scripting let's go to the event
graph and I'm going to Mouse wheel out
just a little bit and drag a a selection
box around these nodes here and just hit
delete we don't need those so those can
get out of here uh so uh this process is
going to be very similar to what we did
with the uh light U setup so we're going
to go through this really quickly here
so I'm going to select our trigger box
and the components window going to right
click in the graph there's our ability
to add events for that trigger box so
again add event Collision there's our
begin overlap we're not going to worry
about the end overlap for this example
for the sake of time uh we're just going
to use the begin overlap to turn it on
if you'd like uh later you can use the
end overlap and turn it off but for us
we're going to start with the add uh on
component begin overlap so go and select
this and it's going to give us our node
there and we need to take our fire we
need to get a reference to our fire uh
so let's go ahead and left click and
drag that into the graph here it's going
to give us our getter so that we can
access and modify this uh fire here and
the property that we used to turn it off
if you recall back in the level editor
here so there's our fire all the way
down at the bottom was that
autoactivate now this property
determines whether or not this uh actor
is auto or this uh component is
autoactivated or not we don't want to
necessarily turn on autoactivate we just
want to activate the thing so we're
going to drag off of fire inside of our
blueprint here and we're we're going to
search for
activate and there it is right there at
the top we can activate or deactivate it
so again if you're going to deactivate
this later come in and use this option
but for our purposes when we overlap the
trigger volume we want to activate it so
go ahead and choose
activate and let's move this note up
just for clarity and let's connect left
click and drag our executable wire into
our activate and that's all we need to
do let's just compile and Save and let's
close this
blueprint and now if we play in the
editor here let me make sure my sound's
down if we play in the editor here we
have our Bush on the other side there if
we approach it and we enter the volume
our Bush now catches fire which is
pretty cool again if you want to set it
up so that when you leave the volume and
turn it off similar to what we did with
our lights uh you could go ahead and do
that although looking at our blueprint
it's kind of coming through the wall
here so we could probably move that out
just a little bit something like that
it's not coming through the wall let's
see ah just a little bit more I mean
nitpicky I think that's fine so we have
taken a different approach uh to
creating a blueprint class uh by
creating an empty actor and adding the
components that we need to it right here
inside of the details panel and once we
were happy with all the components and
uh all the things that we wanted to add
to that uh empty actor we then turned it
into a blueprint and added script to it
uh so that's just a different way
different approach uh you could just as
EAS easily right clicked created a
blueprint class selected actor and then
inside of that new actor actually let's
just do it inside of that new actor
added all those components here uh and
then hop to the event graph and added
the script but it's just a different
workflow I thought we would go through
that process here together and show you
a different way of doing things uh in
fact there's one more approach that
we're going to take uh that you can do
uh before we wrap up this series here uh
and that is turning anything that you've
placed into uh into your level here
turning those into a blueprint into a
blueprint class so way back in the
second video I think it was we created
our room here we created our trigger
volume and our light uh that we set up
so that when the player enters it comes
on and comes off uh and we did that
script inside of the level blueprint uh
which again is self-contained to this
level uh we're going to turn all of this
into a blueprint including this building
so what I want you to do is hop over to
the world outliner we're going to select
all of our all of our wall pieces here
so select uh the First wall there hold
shift and select the bottom wall that's
going to select all of our walls we're
then going to hold control and select
our trigger box and we're also going to
select our Point light so that's going
to select all of those walls that point
light and our trigger box box there
we're then going to hop up to the
toolbar under
Blueprints and under blueprint class
convert selected components to a
blueprint class so go ahead and select
this it's going to again ask us where we
want to save uh this blueprint let's
save it in the blueprints folder and
we're going to call this we're going to
call this the little building well the
little little house BP because that's
nice and friendly Little House BP and
we're going to create a blueprint out of
it
and what that's done for us is take all
those components and everything that we
set up and turn it into a blueprint for
us now if we hop over to the event graph
our event graph is going to be empty we
are going to need to reset up the script
for turning on and off uh our light
there uh so let's go ahead and do that
uh really quickly so I'm going to select
all of our nodes here hit
delete and let's go ahead this is a
little bit of an extra credit I hadn't
intended on doing this but figured I'd
show it so let's go and do this again
really quickly so here's our Collision
component uh let's go ahead and move
this over just a little bit uh if we
right click on it we can add an event
for our Collision component drop the
Collision drop down add on component
begin
overlap and let's select our Collision
component again right click add event
Collision add component end
overlap and just as we did in our level
blueprint now uh let's take our light
component here just left click and drag
that in we're now going to drag off of
it and say toggle visibility it was so
toggle visibility or toggle viz like so
we're then going to take the executable
on our begin overlap and connect it to
our toggle visibility we're going to
take the end and turn it off as
well like so
looks good uh let's make sure let me
select our light component here make
sure that it is still off by default so
let's find that uh visible section which
it still is because we set that already
so that's nice and and helpful for us
let's compile and
save and then let's close this
blueprint so now if we play in the
editor here it's giving us an error one
or more blueprints has an unresolved
compile error are you sure you want to
play in the editor no we don't so what
is the error we're getting actually
let's open up our level blueprint here
or not excuse me not level blueprint Our
Little House blueprint compile I think
it was the level blueprint that was
giving us the error let's double check
so let's open up the level blueprint I
bet you this is what it was so our level
blueprint it's giving us an error
because we had this script it's
basically repeating this script uh
inside of our class blueprint as well as
the level blueprint so it's getting a
little bit confused here we no longer
need any of this so let's actually
delete this out of the level blueprint
that was the problem let's compile our
level blueprint so it is nice and empty
now if we play in the editor shouldn't
give us any errors and if we enter our
room our light should turn on which it
does if we exit turns it off go over to
our Bush that catches on fire and if we
go over to our lights we could still
turn these on and off which is nice and
helpful now the beauty is we've created
all of these as class blueprints now and
let's actually save all of our work here
here let's just save it all so it's
going to save the level that we created
as well as our blueprint classes well
this is the new blueprint I guess we
didn't need to save that but going to
save it anyway uh might ask us to give
us a new name for this new level we're
just going to call this the demo level
like
so so it's saved uh demo level for us uh
let's actually go down to uh let's go to
the third person BP folder we haven't
been in here just yet but we're going to
go back to the maps folder and this is
the default map that was used for this
template so way back in uh video two I
think it was uh we created our new level
we're going to go back to the template
map now so go ahead and open up the
third person example
map so take just a second for it to load
it up this should look familiar and back
in the content browser now let's go to
the blueprints folder let's take our
little house BP and let's left click and
drag that into our new level here
so we can drag that into our level and
we can hold alt and drag out a copy so
while we're holding alt we could drag
out a copy well if I actually hold alt
that would probably help so hold alt and
drag out a copy of it and we could press
e and rotate this one around like so so
the door is facing the other way and we
can move it over something like this we
could hold control and select both of
these so that they're both selected we
could hold alt and drag out two copies
of those and then we could drag in our
burning bush and put it somewhere in the
middle put this one over here and we
could add some of our lights on like so
kind of see what I'm doing here I press
e to rotate it
around press
W like so and we can hold Al alt and
drag out a copy and move this one
over and now we have this little uh
little I guess it's a town of sorts kind
of that example that I was talking about
earlier and we've done this all through
blueprint classes so now we can press
play and we have bunch of different
buildings that we can go in well I guess
I need to move this one up a little bit
because it's clipping into the floor
there like so I guess you do need to
make sure that that doesn't
happen otherwise you can't enter the
room so let's move those up just a
little bit like so there we go so now if
we play now I can go in and this light
comes on one goes off I can go in here
this one comes on and I can exit and our
Bush when I approach it catches on fire
and this new level can come up to this
one press F to toggle so I'm going turn
that one on so as you can see we've uh
set up just three blueprints here and we
were able to uh create instances of
those Blueprints and they just
automatically work in this new level so
that is the beauty of blueprints it's
it's very flexible very quickly you can
prototype uh gameplay scenarios out or
events or or uh as we've done here
little structures and buildings and so
forth so uh that is actually going to do
it for this series uh thank you guys so
much for watching I hope you guys
enjoyed it uh we hope to see you in uh
the next video series uh thank you guys
for tuning in and we'll see you then