This is the way I do it--

I place my npc prefab in the scene. Make sure it has a Character Controller---I add a box with trigger enter checked (size of box collider is 4, 4, 4) and make sure all those fit snugly around my npc.

Then I slide him into a prefab.

I open the ORK editor and go to Base/Control Animations and set up two Animations for him---regular and battle.

Then I go to Combatants and add him there. I slide his prefab where the prefab should go.

I add his animations that I set up in Base/Control Animations.

I add the Move AI that I set up. Pics of my settings for my Move AI called Walk and Talk are below. The Move AI is very simple. I just copied the Hunt Move AI I'd set up and simplified it.

Then I go and set up the waypoints in my scene---just empty game objects I renamed to Waypoint0, Waypoint1, Waypoint2.

Then I use a combatant spawner in the scene, spawn the guy and set its faction to Player. You can also just place the NPC in the scene and use the Combatant script as a component on your NPC if you like rather than spawn him/her using the combatant spawner. I don't think it makes any difference how you do it.

In the spawner I set up the Waypoints 0, 1, 2 and he loops through them. I also made sure the box collider I added to the combatant spawner is big enough so the waypoints I set up are inside the spawner's box collider. Not sure if this matters but it works. : )

Then I set up an event called talkNPCName (name of this npc). It's just a Show Dialogue event so I can talk to the NPC.

It blocks the Move Ai. I added it to one of the waypoints the npc cycles through and put a collider on that waypoint with trigger enter.

So that when I collide with the npc at that point, I get the dialogue and when I close the dialogue he moves on cycling through his waypoints. : )

I could put that event on each of the waypoints if I wanted to and add a box collider to each waypoint and have random dialogues fire so each dialogue would be different
Post edited by Catacomber on
Sign In or Register to comment.