playMaker

Author Topic: Head Look Controller  (Read 2858 times)

JonathanBurroughs

  • Junior Playmaker
  • **
  • Posts: 73
  • Some kind of independent game developer
    • View Profile
    • @HiFiHair
Head Look Controller
« on: July 08, 2014, 12:37:09 PM »
Hello all,

I'm in the process of researching building a head look controller for our NPCs, so they can turn to face the player character when the player is within a certain range and angle of the NPC.

I've started off by looking at Unity's own Head Look Controller which appears on their site:

https://www.assetstore.unity3d.com/en/#!/content/4
http://blogs.unity3d.com/2009/07/10/just-looking-around/

I've yet to get it to work, but I'll carry on playing with it.

I just wondered if there was a PlayMaker-based approach for this kind of thing. I'm okay with C#, but much more confident with state machines.

Having looked at Unity's Mechanim tutorial and some of the IK-based approaches to solving things like animations driven by Oculus head tracking, I get the impression this would be easy to solve using the Mechanim Avatar system.

Unfortunately we're not using Avatars right now. And I think it risks being a time sink changing our workflow.

Any advice gratefully received. I'm going to carry on my experimentation and research in the meantime.

Thanks for your time!

JonathanBurroughs

  • Junior Playmaker
  • **
  • Posts: 73
  • Some kind of independent game developer
    • View Profile
    • @HiFiHair
Re: Head Look Controller
« Reply #1 on: July 09, 2014, 04:54:44 AM »
Ah! I played around with the Unity controller a little more and got it working really nicely.

I copied the values out of the tutorial as a default and suddenly my character sprang to life: http://blogs.unity3d.com/2009/07/10/just-looking-around/

I'm using PlayMaker in conjunction with this, with a FSM to Get Position on my game camera and Set Property to feed the target XYZ into the Head Look Controller.

I'll be adding some additional controls to define a trigger radius around the NPC to toggle the head look on/off and swap the NPC into an idle suitable for head looking.

I might keep this thread open just in case there is a holistic PlayMaker approach to this problem.

reelife

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: Head Look Controller
« Reply #2 on: July 18, 2014, 03:30:38 AM »
Well, if you know how to totally remove the "Only Follow the Mouse cursor" thing Im all game. I have no problem using playmaker but C Sharp is Alien to me.