Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: schinken on May 01, 2017, 01:28:42 PM

Title: Import variables from custom scripts
Post by: schinken 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?
Title: Re: Import variables from custom scripts
Post by: velketor 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.
Title: Re: Import variables from custom scripts
Post by: tcmeric 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.
Title: Re: Import variables from custom scripts
Post by: jeanfabre 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