Playmaker Forum

PlayMaker News => Work In Progress... => Topic started by: jeanfabre on October 09, 2013, 02:26:50 PM

Title: Unity Stealth done with PlayMaker
Post by: jeanfabre on October 09, 2013, 02:26:50 PM
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
Title: Re: Unity Stealth done with PlayMaker
Post by: parallel on March 07, 2014, 11: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?
Title: Re: Unity Stealth done with PlayMaker
Post by: jeanfabre on March 14, 2014, 08: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