playMaker

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

rik

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

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2305
    • View Profile
    • jinxtergames
Re: how to replace if with playmaker bool
« Reply #1 on: October 20, 2015, 11:55:34 AM »
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: 247
    • View Profile
Re: how to replace if with playmaker bool
« Reply #2 on: October 20, 2015, 05: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: 2305
    • View Profile
    • jinxtergames
Re: how to replace if with playmaker bool
« Reply #3 on: October 20, 2015, 10:30:20 PM »
Hi,
Maybe this Tutorial can help you

rik

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: how to replace if with playmaker bool
« Reply #4 on: October 21, 2015, 01: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: 2305
    • View Profile
    • jinxtergames
Re: how to replace if with playmaker bool
« Reply #5 on: October 21, 2015, 09:40:18 AM »
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