|
Post by witchthewicked on Feb 4, 2020 6:27:38 GMT
I wanted to know how I could be able to invoke an enemy AI to attack my player, or if there was a way to more specifically trigger a certain state via C# I have tried this hacked way
vFSMState stateAttack; foreach (vFSMState state in fsmBehaviorController.fsmBehaviour.states)
{
Debug.Log(state.Name);
if (state.Name.Equals("ENEMY_MELEE_ATTACK"))
{
stateAttack = state;
}
}
fsmBehaviorController.fsmBehaviour.ConnectToState(stateAttack);
|
|
|
Post by tchrisbaker on Feb 7, 2020 10:16:54 GMT
Well, the idea of a state machine in general is that you don't explicitly change states. It should change states by what the conditions are and how the conditions are set up in the FSM
|
|
|
Post by tchrisbaker on Feb 7, 2020 10:27:20 GMT
As far as attacking the player, if you use the FSM that Invector provides, the enemy will attack the player. You just have to set up the enemy to target the player's Tag
|
|