playMaker

Author Topic: Import variables from custom scripts  (Read 1430 times)

schinken

  • Playmaker Newbie
  • *
  • Posts: 1
Import variables from custom scripts
« on: May 01, 2017, 01:28:42 PM »
Heho.

I just downloaded Playmaker with minor coding knowledge (did a lot of game stuff already, but more on the art side :) ), and I have one problem.
Whenever I search for the solution I just get very very confusing answers.

So, I guess the solution is already out there, but some of you guys need to break it down to someone like me :). Sorry



I don't really see a way to use variables from my scripts in playmaker.

SO. I have a variable a and want to initiate a transition when it is at a certian value or true or whatever.
I already tried to play around with the GetProperty thing, but it doesn't really work.
Or I have a variable a and want to change it to a different value.

How do I do that?

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Re: Import variables from custom scripts
« Reply #1 on: May 01, 2017, 02:18:50 PM »
The way I play with variables from scripts is to drag the script from my GameObject into PlayMaker and 3 options appear: Get Property, Set Property and Method.  Use the Method option and select the variable you are trying to manipulate.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Import variables from custom scripts
« Reply #2 on: May 01, 2017, 10:55:52 PM »
You need to write a custom action. You can learn how to do so here:
Its not too hard if you are already familiar with C# especially and only looking to pass variables back and forth.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Import variables from custom scripts
« Reply #3 on: May 03, 2017, 01:30:58 AM »
Hi,

 A Custom Action is the way to go, but GetProperty and SetProperty should work, for all public variables in regular components, if your script is not a component then yes, a custom action is mandatory.

 Bye,

 Jean