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
  • Here are my Move AI settings for Walk and Talk----by the way I know how frustrating this must be for you -- hang in there---there's a way I'm sure to make this work for you.

    photo MoveAIWalkandTalk.jpg

    image


    image


    image

    image

    photo MoveAIWalkandTalk6a.jpg
  • My Combatant Spawner settings----

    image

    photo CombatantSpawnerSettings2a.png

    image

    photo CombatantSpawnerSettings4a.png
  • Whenever I try to set up Waypoints, my Combatant walks to the Spawner then will proceed to inch forward slowly to the first Waypoint. If it comes into Combat, it will act normal.
  • edited December 2014
    I don't use a walking, talking npc in a battle area so I'm not much help here. Is your Walk speed a normal walk speed? It sounds like your guy is using the Walk walk speed but and it moves slowly but in battle it will use the Battle Animation speed and that sounds like it's set up correctly.
    Post edited by Catacomber on
  • I keep my walk speeds the same as my run speeds at the moment.
  • edited December 2014
    If your battle animations are ok---there has to be something off about what goes into the slots for movement for the ai when your guy is not in battle mode, I think. I had the same Walk ai for my moving npc tree but I think I tweaked something else for how fast that was. It's hard to reconstruct some things as you do it on the fly, testing what works and then keeping what works and forgetting what you did. : ) You do have a move ai? Right? For the part where your guy moves not using his battle animation.
    Post edited by Catacomber on
  • Yes I use Move AI and use Mecanim Animations. I don't have seperate battle animations, I just animate abilities and use events to play their triggers.
  • I think maybe you need Gil here. I don't use Mecanim. You don't have battle animations for your enemies?
  • edited December 2014
    No I don't have "specified" battle animations. Not yet anyways.
    Post edited by Balive on
  • How can you have Enemies without them? Maybe this is a Mechanim thing though.
  • Are you referring to Battle AI? I do have that set up to use an ability.
  • This is a great tutorial and pretty much the exact answer to what I was looking for a few hours ago. Thanks very much!
  • Is there any chance you could reupload the pictures? That would be awesome!
  • Hi, could you re upload pics? and when you say slide into a prefab, what does that mean exactly?
  • Yes please, This thread is incredible useful
Sign In or Register to comment.