playMaker

Author Topic: How to get minimum value from array list  (Read 1597 times)

raguelmoon

  • Playmaker Newbie
  • *
  • Posts: 4
How to get minimum value from array list
« 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

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to get minimum value from array list
« Reply #1 on: March 11, 2018, 01:29:49 PM »
hi,
you will need to make a loop like on this sample :


raguelmoon

  • Playmaker Newbie
  • *
  • Posts: 4
Re: How to get minimum value from array list
« Reply #2 on: March 12, 2018, 08:42:50 AM »
Thank you dear, but it is not working, are you sure the nodes are wired correctly?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to get minimum value from array list
« Reply #3 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.