playMaker

Author Topic: Unity Stealth done with PlayMaker  (Read 3201 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Unity Stealth done with PlayMaker
« on: October 09, 2013, 11:26:50 AM »
Hi,

 It's been requested few times already, and it's something that I always wanted to start ( I'd like to do angrybots and the other unity demos... but clearly not realistic timewise...)

 Anyway. First step, the player control.

-- This package requires Unity Stealth project.
-- you will find a "PlayMaker Stealth" folder with "PlayMaker Ethan" scene. Open that and you'll have the main character control done in playmaker.

 For this, I needed the quaternion custom action pack and I created also two new custom actions to control the rigidbody rotation, which is more efficient then controlling the transform rotation. The mecanim playmaker action package is also included.

The fsms are very simple, the most tricky being the rotation computation, so proper understanding of quaternion is required to understand how it's done. Basically, It transforms the user input into a "direction" that we then use as a target to lerp the character own rotation ( it's basically an absolute look at system)

I will move this to the wiki when I will have a bit more in, meanwhile, don't hesitate if you have questions or comments.

 Bye,

 Jean

parallel

  • Full Member
  • ***
  • Posts: 155
    • View Profile
Re: Unity Stealth done with PlayMaker
« Reply #1 on: March 07, 2014, 09:11:31 PM »
Very interesting, though it seems to be broken. GetAnimatorIsControlled.cs had  some outdated (I guess) way of doing things, something to do with masks, and threw an error. After deletion of that action up came a stream of this one:

NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.FsmState.GetTransition (Int32 transitionIndex)
HutongGames.PlayMakerEditor.FsmSelection.set_ActiveFsm (HutongGames.PlayMaker.Fsm value)
HutongGames.PlayMakerEditor.FsmSelection..ctor (HutongGames.PlayMaker.Fsm fsm)
HutongGames.PlayMakerEditor.FsmSelectionHistory.GetSelection (HutongGames.PlayMaker.Fsm fsm)
HutongGames.PlayMakerEditor.FsmSelectionHistory.SelectFsm (HutongGames.PlayMaker.Fsm fsm)
HutongGames.PlayMakerEditor.FsmEditor.SelectFsm (HutongGames.PlayMaker.Fsm fsm)
HutongGames.PlayMakerEditor.FsmEditor.SelectFsm (UnityEngine.GameObject gameObject)
HutongGames.PlayMakerEditor.FsmEditor.OnSelectionChange ()
HutongGames.PlayMakerEditor.FsmEditor.OnEnable ()
FsmEditorWindow.Initialize () (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:89)
HutongGames.PlayMakerEditor.BaseEditorWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Any tips on correcting this one?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Unity Stealth done with PlayMaker
« Reply #2 on: March 14, 2014, 05:05:42 AM »
Hi,

 I doubled check this, deleted the offending action and all is well I don't have any issues. Can you test on an empty project?

bye,

 Jean