Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: rik on October 20, 2015, 12:58:15 PM

Title: how to replace if with playmaker bool
Post by: rik 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
Title: Re: how to replace if with playmaker bool
Post by: djaydino 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?
Title: Re: how to replace if with playmaker bool
Post by: rik 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
Title: Re: how to replace if with playmaker bool
Post by: djaydino on October 21, 2015, 01:30:20 AM
Hi,
Maybe this (https://www.youtube.com/watch?v=QVG-336_PsM) Tutorial can help you
Title: Re: how to replace if with playmaker bool
Post by: rik 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.
Title: Re: how to replace if with playmaker bool
Post by: djaydino 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