Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Enemy Projectile BP & Fire Projectile | Enemy Blueprints
Unreal Engine FPS Game
course content

Зміст курсу

Unreal Engine FPS Game

Unreal Engine FPS Game

1. Unreal Engine Introduction
2. The Character Blueprint
3. Enemy Blueprints
4. Level Design and Aesthetics
5. User Interface and Sound Effects
6. Gameplay Logic
7. Packaging for Windows

bookEnemy Projectile BP & Fire Projectile

In this chapter we make a projectile that the enemies can shoot at us!

To do that, make a blueprint of the class Actor.

Then, add two components, one a sphere collision, and the other a sphere (mesh). Adjust their sizes so that they are nice and small.

Then add a Projectile Movement component and set the first property in the Velocity to 1000. Also, in the details panel, search for Projectile Gravity Scale and set that to zero.

Select the sphere collision that you created and in the details panel click on the plus button in front of On Component Begin Overlap. Drag out of Other Actor and search for cast to BP_FirstPersonCharacter. Then drag out of the blue output pin As BP First Person Character and call the Take Damage function that we created in the previous section. Drag out of As BP First Person Character again and Get Player Health. Create a Print String Node and connect the execute pin of our Take Damage to it, and print out the Player Health variable.

Now let’s go to the BP_EnemyChar or whatever you named the Enemy blueprint. Create a delay node with a duration of 2 seconds. Then connect Simple Move to Actor and Set Actor Rotation to it.

Drag out of the Completed pin and search for Spawn Actor of Class and in the Class, choose BP_EnemyProjectile. Right click on the Spawn Transform and select Split Struct Pin.

Right click and search for a node called Get Actor Transform. Right click on the output of it and choose Split Struct Pin.

Connect the location to the spawn actor’s location and the rotation as well. Leave scale as is. And that is it!

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 3
some-alt