Author Topic: Puppet2D Flip Action  (Read 662 times)


  • Full Member
  • ***
  • Posts: 105
    • View Profile
Puppet2D Flip Action
« on: April 11, 2017, 07: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
  • Have a folder for custom actions, e.g. Assets/Playmaker/Actions Custom. You can then later copy that folder for use in another project.
  • Create the file manually, or use Playmaker's Custom Action Wizard (under Playmaker > Tools)
  • The file's name must be identical to the name given as public class ("Puppet2DFlip"). Any such name can only exist once in the project, but you can change it as long as you keep it consistent.


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

namespace HutongGames.PlayMaker.Actions

[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;

« Last Edit: April 11, 2017, 07:29:21 AM by Thore »