Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Kubold on May 19, 2014, 04:18:46 AM

Title: Pick lowest value from couple of floats
Post by: Kubold on May 19, 2014, 04:18:46 AM
Hello!

What would be the easiest way to pick lowest value from couple of float variables?

For example we have 4 floats with different values. We want to always pick the lowest (every frame). Is there an Action for that or do I make a super complicated graph using "float compare" for every of 2 floats (if it's just 4 floats than no problem, but what if it's 50)?

Thanks!
Kuba
Title: Re: Pick lowest value from couple of floats
Post by: Kubold on May 19, 2014, 04:56:37 AM
Ok, I found this:

http://hutonggames.com/playmakerforum/index.php?topic=1599.0 (http://hutonggames.com/playmakerforum/index.php?topic=1599.0)

Mathf.Min

"Description
Returns the smallest of two or more values."

So this action compares two values. Can it be modified so you can choose how many values you compare?
Title: Re: Pick lowest value from couple of floats
Post by: jeanfabre on May 26, 2014, 04:11:30 AM
Hi,

 You have now two new custom actions features on the ecosystem that do excatly that. And the latest version of ArrayMaker also features this kind of functions.

 If you want to use the ecosystem browser, get it here:
https://hutonggames.fogbugz.com/default.asp?W1181

and then simply search for "min" or "max", and it will be listed there.


Else you can get the custom actions directly on the public repository:

https://github.com/jeanfabre/PlayMakerCustomActions_U3/blob/master/Assets/PlayMaker%20Custom%20Actions/Math/GetFloatsMin.cs

https://github.com/jeanfabre/PlayMakerCustomActions_U3/blob/master/Assets/PlayMaker%20Custom%20Actions/Math/GetFloatsMax.cs



 Bye,

 Jean
Title: Re: Pick lowest value from couple of floats
Post by: Kubold on May 26, 2014, 04:45:13 AM
Thanks! I'll check out this Ecosystem thingie, sounds awesome.