Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: frostamation on July 10, 2014, 02:42:03 PM

Title: changing a value on a custom script via playmaker
Post by: frostamation on July 10, 2014, 02:42:03 PM
I tried to google a solution but was unsuccessful at finding a solution so if there is one feel free to post a link to it and ill read it.

What im tring to do is increase players speed via a level up system.

I have a gui made with advances the player can choose, one of which is make your vehicles you drive faster.

the script has "public float forwardForce = 10f;"
which controls how fast they move, i can edit this in the editor but that does no good for game play.

Im trying to access this variable via playmaker, I have it setup so if player opens tech tree and clicks "speed" it will increase the variable by X amount.

I went through the entire action browser and was unsuccessful with trying to get access to this variable, much less trying to store it as a variable and access it again.

I know once i can get and store the variable i can use "set int value" which should work for changing it, but how do i get the variable and store it first?

any help appreciated. hopefully what im needing makes sense. Thanks
Title: Re: changing a value on a custom script via playmaker
Post by: Alex Chouls on July 10, 2014, 02:46:25 PM
Use the Get Property and Set Property actions.

There are tutorials on the YouTube channel...
Title: Re: changing a value on a custom script via playmaker
Post by: frostamation on July 10, 2014, 03:17:54 PM
i saw those and tried then before, but i just now watched the youtube video called get and set property and i was unaware that you can drag/drop a script and it will ask get/set. which worked. before when i did it none of the script variables showed up. but either way its functioning now! thanks!
Title: Re: changing a value on a custom script via playmaker
Post by: Michaelb on July 10, 2014, 04:32:47 PM
Dont forget to mark as [SOLVED] so we know that a solution is found  ;)