playMaker

Author Topic: How to make the Float add process go more smoothly  (Read 1271 times)

playmakertester

  • Full Member
  • ***
  • Posts: 211
How to make the Float add process go more smoothly
« on: September 23, 2020, 06:42:29 AM »
Hi,

I want to increase a variable from 1 to 2 to 3..., but I don't want to increase it by one in one State, but I want to increase it in a finer way, such as from 1 to 1.1 to 1.2..., so that when it reaches 2 at the end, it changes to the next State. (sighs)

If you have any good actions to take, please let me know.

curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: How to make the Float add process go more smoothly
« Reply #1 on: September 23, 2020, 08:16:40 AM »
A Float variable does exactly that, 1.0000, 1.0001, 1.0002 etc

An Integer variable counts in whole number, 1,2,3 etc

Look at Float Interpolate, or Float Ease. I can't remember if they're on the Ecosystem or part of vanilla Playmaker.
« Last Edit: September 23, 2020, 08:18:34 AM by curb47 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: How to make the Float add process go more smoothly
« Reply #2 on: September 23, 2020, 08:48:02 AM »
Hi.
You can do a 'Float Add' and set per second, to display you can use float to string and set format to 0,0

Then you can also have a float compare to check if 2 is reached.

playmakertester

  • Full Member
  • ***
  • Posts: 211
Re: How to make the Float add process go more smoothly
« Reply #3 on: September 23, 2020, 11:43:32 AM »
Hi curb47, djaydino

Thanks for detail. Let me try.

playmakertester

  • Full Member
  • ***
  • Posts: 211
Re: How to make the Float add process go more smoothly
« Reply #4 on: September 23, 2020, 11:49:34 AM »
to display you can use float to string and set format to 0,0

Hi djaydino,

Would it be possible for you to tell us what the purpose of this explanation is?

Best,

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: How to make the Float add process go more smoothly
« Reply #5 on: September 23, 2020, 12:02:02 PM »
Hi.
my bad, The format should be 0.0 btw not 0,0


If you want to show the value in UI and you want only to show 1.1 you can use the format 0.0

if you want for example 1.11 then set format 0.00
if you want for example 01.11 then set format 00.00
if you set no format it will show the complete float (1.235662345)