playMaker

Author Topic: Charging a value in a state  (Read 2339 times)

kmeris

  • Playmaker Newbie
  • *
  • Posts: 2
Charging a value in a state
« on: June 24, 2015, 12:30:14 PM »
Im wondering how can I charge a float value in a state.

My build is basic 1st state is waiting for button press 2nd is where i want to combine charging state if possible and 3th is simply adding the force charged.

I tried using time actions but they didnt seem to work because of button on realease

terri

  • Sr. Member
  • ****
  • Posts: 389
    • terrivellmann.tumblr.com
Re: Charging a value in a state
« Reply #1 on: June 24, 2015, 01:14:02 PM »
So you have:
STATE 1: Get OnButtonPress
STATE 2: Float X Add 1 (every frame or per second), Get OnButtonRelease
STATE 3: AddForce (Float X)

And that isn't working?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Charging a value in a state
« Reply #2 on: June 24, 2015, 02:53:16 PM »
Hi,

 Terri's solution will work :)

 Bye,

 Jean

kmeris

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Charging a value in a state
« Reply #3 on: June 24, 2015, 03:41:17 PM »
Thats what i did but oddly enough force didnt multiply then, now it works fine tho

thank you guys anyways :D
« Last Edit: June 24, 2015, 03:43:37 PM by kmeris »