playMaker

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

frostamation

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
changing a value on a custom script via playmaker
« on: July 10, 2014, 11:42:03 AM »
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, 11:44:20 AM by frostamation »

Alex Chouls

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

There are tutorials on the YouTube channel...

frostamation

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: changing a value on a custom script via playmaker
« Reply #2 on: July 10, 2014, 12: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
    • View Profile
Re: changing a value on a custom script via playmaker
« Reply #3 on: July 10, 2014, 01:32:47 PM »
Dont forget to mark as [SOLVED] so we know that a solution is found  ;)