In this part, I will setup map's navmesh to make monsters able to move (and also make player's character able to move by point click controlling) and create first monster character
Open map scene (
000_Leveling_Test) first, because we are going to create nav mesh for this map.
Navigation window from menu
Window -> AI -> Navigation.
Navigation window, select
Object tab, select sources for nav mesh creation, in this scene has only one mesh (because we made this scene just for testing). It is
Floor, select it and tick on
Bake tab click
Bake button, and nav mesh will be created, save the scene, and... done!.
You can create new character easily by
Character Entity Creator dialog
Before you use this tool, you have to prepare character model prefab
I will uses characters from RPG Monster Wave Polyart
My first monster that I am going to create is
So I will prepare Slime character model prefab by duplicate
Slime prefab from
Assets/RPG Monster Wave Polyart/Prefabs/PolyartDefault by select it, press
Then drag duplicated prefab to
Assets/Leveling/Prefabs/MonsterCharacters and rename it to
And delete all components except
Now a new character model preparation is done, next I'm going to create new monster character entity based on this character model.
Open the dialog from menu
MMORPG KIT -> Character Entity Creator (3D)
Then I will set filename to
Character entity type to
Monster Character Entity, set
Entity movement type to
Nav Mesh, Select game database which created for this project (It is
LevelingGameDb which was created in first part) and set
FBX to prepared character model prefab
After set data in the dialog, press
Create button, then it will shows folder choosing dialog, select folder which you want to save, Mine will be saved to
Then data will be created in selected folder
And also added to the game database
RPG Monster Wave Polyart
have an animations for characters, so I will show how to set character's animations by use animations from the package.
To set character's animations, you have to open the character entity prefab. For this character, I've saved it to
Assets/Leveling/GameData/MonsterCharacters/Slime so I will go to the folder and open prefab
Then find attached
Playable Character Model component
Default Animations, set following clips
Assets/RPG Monster Wave Polyart/Animations/Slime/IdleNormal_Slime_Animto
Default Animations -> Idle State -> Clip.
Assets/RPG Monster Wave Polyart/Animations/Slime/Run_Slime_Animto
Default Animations -> Move States -> Forward State -> Clip.
Assets/RPG Monster Wave Polyart/Animations/Slime/GetHit_Slime_Animto
Default Animations -> Hurt State -> Clip.
Assets/RPG Monster Wave Polyart/Animations/Slime/Die_Slime_Animto
Default Animations -> Dead State -> Clip.
Default Animations -> Right Hand Attack Animations set 2 attack animations by uses clip from
Assets/RPG Monster Wave Polyart/Animations/Slime/Attack01_Slime_Anim and
Assets/RPG Monster Wave Polyart/Animations/Slime/Attack02_Slime_Anim
Now, your character is ready to use, let's add it to the game map.
There are 2 ways to add monster to the map.
First, drag a prefab to the map scene, that is it.
Second, create game object and attach
Monster Spawn Area component
Slime character entity prefab to
Monster Spawn Area component ->
Set random level and spawning amount as you wish, I will set spawning amount to
10 so when start game it will spawn
Then test the game, you will see 10 Slimes spawned.
You can't attack monster which created by
Character Entity Creator because it has no collider attached yet, you can attach any collider to the prefab but you have to set it as trigger collider.
For the Slime, I will attach box collider.
Then save the prefab, test the game again, you will be able to click on monster to attack.
It is because there is no monster activity component attached to the Slime yet, you have to attach
Monster Activity Component to the Slime prefab.