Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: raguelmoon on March 11, 2018, 01:03:44 PM

Title: How to get minimum value from array list
Post by: raguelmoon on March 11, 2018, 01:03:44 PM
Hi everyone!
How to get minimum value from a array variable (say float[] distance)?
suppose I have a distance array consists of 4 values: distance[1, 2, 3, 4] and i want to get minimum values from it (which is 1) and save in another float variable.
Thanks in advance!
Ram
Title: Re: How to get minimum value from array list
Post by: djaydino on March 11, 2018, 01:29:49 PM
hi,
you will need to make a loop like on this sample :

(https://i.imgur.com/squOMgD.gif)
Title: Re: How to get minimum value from array list
Post by: raguelmoon on March 12, 2018, 08:42:50 AM
Thank you dear, but it is not working, are you sure the nodes are wired correctly?
Title: Re: How to get minimum value from array list
Post by: djaydino on March 12, 2018, 11:18:10 AM
Hi.
Oops i forgot to add an event on the float compare :

On 'Greater Than' add the "Not Lower" event.