Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: Thore on April 11, 2017, 10:26:33 AM

Title: Puppet2D Flip Action
Post by: Thore on April 11, 2017, 10:26:33 AM
If you are using Puppet2D, you probably want to flip the character to move in the opposite direction. This tiny action will help you do that.

How to Use Custom Actions

Puppet2DFlip.cs

Code: [Select]
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

namespace HutongGames.PlayMaker.Actions
{

[ActionCategory(ActionCategory.Animation)]
[Tooltip("Flip character using the Puppet2D Flip variable")]
public class Puppet2DFlip : FsmStateAction
{
Puppet2D_GlobalControl script;
public FsmGameObject globalCTRL;
public FsmBool flip;

public override void OnEnter()
{
script = globalCTRL.Value.GetComponent<Puppet2D_GlobalControl>();
script.flip = flip.Value;
Finish();
}
}

}