当前位置:网站首页>How to add a game character to a UE4 scene

How to add a game character to a UE4 scene

2022-08-01 22:07:00 InfoQ

Foreword

In the previous article, I organized the relevant content of how to develop Android in UE4.Today, I will tell you how to add game characters to UE4 scenes.

Steps

This article does not involve code, so it looks relatively simple, so I won't talk nonsense, and this is the beginning.

Create a subclass of Character

In the UE4 editor, open File - New C++ Class.

null
Select Character type, I'm here to name this subclass that inherits from the Character type: Hero.

null
After creation, your VS project will have two more files, Hero.h and Hero.cpp, which I will explain to you in the next article.

Import resources

UE4's mall provides us beginners with a lot of free resources for us to use, so I also plan to use its free resources in today's article to open Epic LauncherOr the web version of the epic store, then search for Animation Starter Pack.

null
null
Then add the downloaded resources to the project you want to import.

null
After importing,There will be an additional resource AnimStarterPack in your project.

null

Create a blueprint class for the character

In the UE4 editor, open window - Developer Tools - Class Viewer to create a blueprint class.

null
Search me inThe Hero class created above, then right-click to create the blueprint class BP_Hero.

null

Add Mesh and Animation

h4>
Select Mesh in the BP_Hero blueprint class.

null
Then find Mesh in the right panel and select SK_Mannequin in Skeletal Mesh.

null
In the Animation sectionSelect UE4ASP_HeroTPP_AnimBlueprint.

null

run

Drag BP_Hero into our scene.

null
to run, wecharacter appears in the scene.

null

last

At this point, I have completed putting the character into the scene. Is it very simple? In the next article, I will tell you how to make the character run in our scene through code.
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/213/202208012206229736.html