playMaker

Author Topic: how to replace if with playmaker bool  (Read 2220 times)

rik

  • Full Member
  • ***
  • Posts: 246
how to replace if with playmaker bool
« on: October 20, 2015, 12:58:15 PM »
Hi
i want to replace if in c#
with playmaker bool true can any one share script

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: how to replace if with playmaker bool
« Reply #1 on: October 20, 2015, 02:55:34 PM »
Hi,
i think we need a bit more info to know what you want

Do you want a playmaker bool to connect to a C# script?

rik

  • Full Member
  • ***
  • Posts: 246
Re: how to replace if with playmaker bool
« Reply #2 on: October 20, 2015, 08:47:37 PM »
yea i want to connect playmaker in to script
i have if statements i need to replace with playmaker

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: how to replace if with playmaker bool
« Reply #3 on: October 21, 2015, 01:30:20 AM »
Hi,
Maybe this Tutorial can help you

rik

  • Full Member
  • ***
  • Posts: 246
Re: how to replace if with playmaker bool
« Reply #4 on: October 21, 2015, 04:53:04 AM »
This tutorial does not teach how to replace "if" any one can share sample script
replacing "if "with playmaker bool true.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: how to replace if with playmaker bool
« Reply #5 on: October 21, 2015, 12:40:18 PM »
Hi, try this :

Code: [Select]
using UnityEngine;
using System.Collections;
using HutongGames.PlayMaker;

public class GetBoolSample : MonoBehaviour
{
public bool theBool;

// Use this for initialization
void OnEnter ()
{
}

// Update is called once per frame
void Update ()
{
theBool = FsmVariables.GlobalVariables.GetFsmBool("MyBool").Value;

if(theBool)
{
Debug.Log("bool is true");
}
}
}

MyBool = the Playmaker global bool