3/6


Start your day with a warm-up

Irony or Coincidence

Tell me a story about something that happened to you that was ironic or crazy coincidence...

Example

When I was in 8th grade, I was not the mature and stoic instructor that you know today. I was a chucklehead and when we went to the high school field trip to check out the school and do the tour, I was acting a fool in the autoshop class. The teacher was this bald guy with a thick mustache and he has a sign in his room that read "Bald is Beautiful".

We my 8th grade brain just could not handle it and was laughing in hysterics. This clearly made the teacher very upset but I could not stop laughing, I was trying but it just didn't happen.

So this guy was heated and popped off at me... "You will never do anything in your life"

So the irony?

He was an ROP Teacher and years later what is my career?

ROP Teacher 



What are you learning?

Weapon System, changing animations, importing meshes.


Why is it important?

This is the start of everything. We are building a game so it is important that you follow along. If you start going on your own and fall behind, it is unfair to stop the class because you chose to do your own thing. If you are confident that you know what you are doing, I have no issues with you moving on your own but you will be held accountable for the project.

How do you show that you understand? What is the assignment?

Follow along and build the game.

Plan on presenting your project ideas

From the create heathbar widget output add a add to viewport node AND connect the return value to target

Compile, save, test

Now make an enemy health bar

In your UI Folder, duplicate the WP Healthbar and name it WB_EnemyHealthBar

Open the new file

Move it to the center and change the color if you wish

Find Progress in the Details panel

In Percent, select the binding dropdown and select Create Binding

Switch from Designer Mode to Graph Mode (top left)

Open your WB_Healthbar and copy the info in the graph

The paste it in the WB_EnemyHealthBar

Delete Get Player Character

Delete Cast to BP_ThirdPersonCharacter

Disconnect the Get percent and Return Node

From Get Percent 0, pull out Get All Actors of Class

The Actor Class is going to be BP_Enemy

From Out Actors, putt out Get a Copy Node

From Get A Copy, pull out Cast to BP_Enemy

Connect the Get All Actors of Class to the Cast to BP Enemy

Delete the Target Self Health and Return Node

As BP_Enemy output

Add Get Health Node

Connect the health to the top number (because you want to divide the health number by 50)

Connect the Cast to Enemy output to the Return Node input

Open up your BP_Enemy Viewport

Select the capsule

In Components

Add Widget

Name it Health Widget

With your Health Widget Selected

Find User interface in your Details panel

Under Widget Class Dropdown

Select WB_EnemyHealthBar

Move it to where you like

Compile and Save

When we play the game, the healthbar doesn't always face the camera

Open the Enemy Event Graph

Under Attack Player

Add Event Tick

A tick is a frame

Pull put your health widget from components

From the health widget, pull out Set world Rotation

From the Event Tick pull out and add cast to BP ThirdPersonCharacter

From Your Cast to BP_ThirdPersonCharacter Object, pull out Get Player Character

From Your Cast to BP_ThirdPersonCharacter Object Connect to Set World Rotation

From the New Rotation input

Pull out Find Look at Rotation

Add another health widget

From the new health widget, pull out Get World Location

Add Get Player Character

Pull out Get Actor Location

Connect to the target of Find Look at Rotation

Connect the Get World Location output to the Start input of Find Look at Rotation

Now let's fix the Enemy being able to hit after being out of health

In BP Enemy

After Simulate Physics

Grab Character Movement from components and bring it into the event graph

Pull out Stop Movement Immediately

Connect to Set Simulate Physics Output

Create a new boolean variable called isDead in My Blueprint

Drag the isDead Variable in and Set it to true then connect to stop movement immediately

Find your chase player node in the BP Enemy Event Graph

Add a branch between the Chase Player and AI MoveTo

Drag in the isDead Variable in

Add a NOT boolean from the isDead Node

Connect it to the condition of the branch

So the Is not Dead will let the enemy chase the player 

We will do the same thing to the attack

Select the platform

In Outliner

Select the floor

Click Convert to Blueprint

Make it a sub Class Floor Blueprint

In the Floor_Blueprint

Go to event graph

Add event hit

From other pull out cast to BP ThirdPersonCharacter

As BP ThirdPerson pull out apply damage

Base damage 999

Compile Save Test

That's it for today