playMaker

Author Topic: Pathfinding Walking AI in PlayMaker  (Read 3865 times)

Jotunheim

  • Playmaker Newbie
  • *
  • Posts: 8
Pathfinding Walking AI in PlayMaker
« on: March 30, 2014, 05:48:04 AM »
Hello Mates,

  I am thinking about making some AI just to get them to walk along a path and avoid obstacle in order to make a scene more "Alive".

  Did some of you tried to do it with PlayMaker? For the waypoint you use an  Empty Gameobject?

  For walking I suppose that you have to call an animation each time the character move forward (like variable speed) but what about turning Right or Left animation?
 
« Last Edit: March 30, 2014, 06:36:13 AM by Jotunheim »

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Pathfinding Walking AI in PlayMaker
« Reply #1 on: March 30, 2014, 01:36:44 PM »
You can mess around with the variety of 'casts' available to see which fits best for your character.

For example, you put a raycast on X and when it collides with an object tagged wall, you can rotate the character and begin moving in the direction.

The real way to do this is with navmesh, astars pathfinder, Rain, or any sort of pathfinding agent available. But the quick and dirty way is with those raycasts.

As for the left and right animations, I guess you are using mecanim? That would be more with unity than playmaker but there are actions here for it as well. If you haven't check out the tutorials on Mecanim I would see this.


It glosses over some important areas, unfortunately, but the essentials are there.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Jotunheim

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Pathfinding Walking AI in PlayMaker
« Reply #2 on: March 30, 2014, 05:46:18 PM »
Thanks for the reply Sebaslive!

Well that is what I am going to do then.
I did watched the Mecanim video tutorial but if I create a blend tree with Walk-Walk Right-Walk Left how to call the walking animation once that avatar is moving with playmaker? (so far the avatar moves with iTwen move so it moves but without triggering the animation)...

EDIT : in fact there is no video or written tutorial about this but there is a demo scene made by the PM guys (Lane or Jean?) that could explain everything! here: https://hutonggames.fogbugz.com/default.asp?W1031

I will check and give feed back for others
« Last Edit: March 30, 2014, 07:51:13 PM by Jotunheim »

Jotunheim

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Pathfinding Walking AI in PlayMaker
« Reply #3 on: March 31, 2014, 11:15:14 AM »
OK with the demos I started getting it.

But when the avatar is moving with iTween MoveTo I can get the speed to call the walking animation but I need to store the results for direction as well but the action Get transform store line remain red I can't enter a variable, What am I doing wrong?

Jotunheim

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Pathfinding Walking AI in PlayMaker
« Reply #4 on: April 01, 2014, 05:51:27 AM »
Sorry to bump, I  tried but fail, did anyone know an action in Playmaker which get the AI direction and store it in a variable for Mecanim?

For speed, there is Get Speed and it works... but for direction?..

A little help will be greatly appreciated...