playMaker

Author Topic: Checking a variable value in a script[SOLVED]  (Read 3671 times)

kenmarold

  • Playmaker Newbie
  • *
  • Posts: 14
Checking a variable value in a script[SOLVED]
« on: July 27, 2015, 02:48:08 PM »
I have a C# script that checks for the number of children in a GameObject and then stores that number in an int variable. How can I access that that variable from Playmaker? I want to create a state that checks that variable in order to determine what confirmation dialog the user sees.
« Last Edit: July 30, 2015, 09:23:12 AM by jeanfabre »

DarkSoul

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Checking a variable value in a script
« Reply #1 on: July 27, 2015, 05:05:55 PM »
Hello,

Drag that script into your fsm state and choose get property and set it to everyframe then use int compare to do what you want.
Keep in mind that the int variable has to be public.

I hope this helps.

kenmarold

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Checking a variable value in a script
« Reply #2 on: July 28, 2015, 10:33:23 AM »
When you say drag the script into my FSM state, would I use the 'Get FSM Int' or 'Set FSM Int' action?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

kenmarold

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Checking a variable value in a script
« Reply #4 on: July 29, 2015, 10:42:32 AM »
Thank you, that video explained it perfectly.  :)