2/26


Start your day with a warm-up


https://www.hollywoodreporter.com/business/business-news/wonder-woman-video-game-canceled-gaming-studios-shut-down-1236146772/


Half page summary with your opinion.




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.

Grab this animation and copy it to your desktop

Compile save test 

Compile, save and test

You can see that you are getting hit once

In out BP Enemy, we have the attack player set once

What we need to do is connect the Attack Player Output back into the Retriggerable Delay input

Follow along here! In your Enemy Blueprint

We have a bug

We are taking damage and getting attacked from a distance

Pull out from Is In Radius

Add NOT Boolean

Your player should not be attacked until they hit the collision

Drag the Paired_PushShove_Att.fbx into your enemy animations folder in the content drawer

select SK Mannequin Skeleton

Import All


Right Click on the new animation

Retarget Animation Assets > Duplicate and Retarget Animation Assets

Click the IK Retargeter

Select the RTG_UE4Manny_UE5Manny

Name the new animation Enemy_Attack 

Add it to your Enemy_Animations Folder

We want to play this animation from the blueprint

To do this

Right Click

Create Animation Montage

Open the montage

Open AnimGraph in your ABP_Enemy 

Remember we added this?

That DefaultSlot is in our montage

Go to your BP_Enemy Event Graph

Compile and Save

In your Attack Player Area

Pull out a node from the output of the apply damage node

Add play Anim montage

**MAKE SURE YOU SELECT PLAY ANIM MONTAGE AND NOT PLAY MONTAGE***

Click dropdown for Montage to Play

Enemy_Attack_Montage

Compile, save and test

The problem we are having with our attack is that when the player hits the AttackRadius collision, the info is not sent to the player.

We need to add a Cast to BP_ThirdPersonCharacter after the overlap

We need to do the same thing when the player is no longer in the attack radius (end overlap)

Now we need to get rid of the NOT in our attack player because we WANT the enemy to attack when it is in radius

When the enemy is attacking, the camera is getting weird because the camera is detecting the enemy as an obstacle (UE wants to make things look and feel real right?)

Go to the viewport of the Enemy and select the mesh

Find collision presets

Choose custom

Set your Camera to ignore

Do the same for the capsule

Compile, save, test

Now we want the animation to start playing as soon as the player is in the attack radius

To do this, we need to move the Play Anim Montage after the Is True Branch in the event graph

Next we will add a little delay before we cast to the BP ThirdPersonCharacter

Open your montage and scrub to where the attack actually happens

I am choosing .26

Back to the Enemy Event Graph

Add the .26 to your delay

Compile, save, test

Open up your ThirdPerson BP Event Graph in the health system

Remove the connection from the branch to set silulate physics

Add Destroy Actor

Compile, save test

It's not working!!! I am not happy

Open up the ThirdPersonCharacter BP

You can see that after we subtract one, nothing is connected

Connect it to the Set

Okay we can die now but we are not respawning

Open the Level Blueprint

In your level blueprint event graph, add a custom event

Name it Respawn

Add a 2 second delay

Add Open Level (by Name)

Add Open Level (by Name)

Go to your level and find Game Mode in your World Settings

In GameMode Override

Set your Selected GameMode to BP_ThirdPersonGameMode

In your content drawer, open Content>Thirdperson>Blueprints>BP_ThirdPersonGameMode

Click Open Full Blueprint Editor

Copy the Respawn Delay and Open Level (by name) nodes in your Level Event Graph

Paste it in your BP_ThirdPersonGameMode Event Graph

What we are doing here is making the respawn in the game mode so that we can reference it in the Character Blueprint

Open the third person BP

Break the link between the branch and destroy actor

From the True output in your branch

Add Cast ti BP_ThirdPersonGameMode ** MAKE SURE IT'S THE GAME MODE!!!**

Pull out the Object input from Cast to BP_ThirdPersonGameMode

Add Get Game Mode Node

Connect GameMode output to Destroy actor

Pull out the Object input from Cast to BP_ThirdPersonGameMode

Add Get Game Mode Node

Connect GameMode output to Destroy actor

Connect respawn to destroy actor

Compile, save test