playMaker

Author Topic: Animator.ResetTrigger action missing?  (Read 4585 times)

jaybury

  • Playmaker Newbie
  • *
  • Posts: 5
Animator.ResetTrigger action missing?
« on: July 13, 2015, 02:59:07 PM »
Hey :)

I'm using the "Set Animator Trigger" action but don't seem to be able to find an action for Resetting the trigger.

The action itself says you can set the trigger to "active or inactive" but there doesn't seem to be any options other than the trigger and the gameobject.

http://docs.unity3d.com/ScriptReference/Animator.ResetTrigger.html

I would like to be able to set a Trigger but then reset it later to false under certain conditions (without using consuming it in a transition)

Could someone please tell me if something like this exists - or could we please have it made? I've searched the forums and couldn't find anything similar!

Thanks!

jaybury

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Animator.ResetTrigger action missing?
« Reply #1 on: July 13, 2015, 03:22:45 PM »
Ok I solved it myself, I just duplicated and renamed the Set Animator Trigger action and replaced the _animator.SetTrigger(trigger.value) with a _animator.ResetTrigger(trigger.value), and all seems to be working well

Thanks anyway - I really should learn a bit more about creating custom actions :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Animator.ResetTrigger action missing?
« Reply #2 on: July 17, 2015, 05:43:05 AM »
Hi,

 I'll add this action, but basically what I have so far ( before that method was available), I was simply waiting one frame and then I would set the animation trigger to false, using SetAnimatorTrigger, because essentially this is exactly what resetTrigger does.

Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Animator.ResetTrigger action missing?
« Reply #3 on: July 17, 2015, 09:46:39 AM »
Hi jaybury,

you can always share your custom actions on the share new actions section :)