Make enemy attack to player

Add an event to the attack animation.

I added as below.

Function : SendEvent

String Attack1-1

Put a 3D Cube in the 3D character Sword to use for the attack.

Check the is trigger.

TurnOff Mesh Renderer after fix position.

Change the cube name for understand.

Finaly disable the cube.

Make FSM for Attack

Use Trigger Event and add cube.

Actviate Game Obeject

When the previously set animation attack event is delivered to the FSM, it activates the tube for the attack trigger.

and I added sfx for sword swing

Send Event Data for calculate damage and damage popup text

Add the cylinder and attach the player teg for test.

And add Character Controller.

It will look at the player and go towards navpoint and then attack the player after stopping at 3meter.

by FSM added by enemy move

Turn off move animation and add a state to turn on attack animation

The results are as follows

Similar Posts