playMaker

Author Topic: changing a value on a custom script via playmaker  (Read 2698 times)

frostamation

  • Playmaker Newbie
  • *
  • Posts: 6
changing a value on a custom script via playmaker
« 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
« Last Edit: July 10, 2014, 02:44:20 PM by frostamation »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: changing a value on a custom script via playmaker
« Reply #1 on: July 10, 2014, 02:46:25 PM »
Use the Get Property and Set Property actions.

There are tutorials on the YouTube channel...

frostamation

  • Playmaker Newbie
  • *
  • Posts: 6
Re: changing a value on a custom script via playmaker
« Reply #2 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!

Michaelb

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 53
Re: changing a value on a custom script via playmaker
« Reply #3 on: July 10, 2014, 04:32:47 PM »
Dont forget to mark as [SOLVED] so we know that a solution is found  ;)