|
Post by karate on Mar 9, 2020 14:49:17 GMT
I am trying to get the enemy to start as idle and then change to patrol waypoints after a particular amount of time. How do i do this?
|
|
|
Post by Invector on Mar 9, 2020 15:58:46 GMT
You can use the vEventsWithDelay to trigger an event that calls a method to change the behavior after a period of time
|
|
|
Post by karate on Mar 9, 2020 16:22:52 GMT
could you tell me which method i should use to change the behavior?
|
|
|
Post by karate on Mar 9, 2020 16:28:52 GMT
is there a pre-written method to change the enemy's current state or will i have to write one into the AI controller script?
what are the lines of code if i have to write it manually?
|
|
|
Post by Invector on Mar 9, 2020 16:49:31 GMT
You can change the health using the method ChangeHealth. Are you using the FSM AI Template or the Simplee Melee AI included in the MeleeCombat package?
|
|
|
Post by karate on Mar 10, 2020 7:00:27 GMT
iam using the simple melee ai and i want to change the the enemies state from idle to patrol. which method do i use?
|
|
|
Post by Invector on Mar 10, 2020 15:05:32 GMT
iam using the simple melee ai and i want to change the the enemies state from idle to patrol. which method do i use? There are no methods to change the current state for the Simple Melee AI, but it's very easy to add Just open the v_AIController script and add these methods: public virtual void ChangeStateToIdle() { currentState = AIStates.Idle; }
public virtual void ChangeStateToPatrolWaypoints() { currentState = AIStates.PatrolWaypoints; }
You can call them using events via inspector or other scripts.
|
|