playMaker

Author Topic: Don't repeat option doesn't work correctly? [SOLVED]  (Read 1259 times)

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Don't repeat option doesn't work correctly? [SOLVED]
« on: March 31, 2021, 06:56:08 AM »
v1.9.1.f7p5
Unity 2018.4.31

Or I'm a doing something wrong?


or does it only compare 1 previous value to next?

Meaning I can get 1,0,1. But I can't get 1,1...
« Last Edit: March 31, 2021, 09:03:28 PM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Don't repeat option doesn't work correctly?
« Reply #1 on: March 31, 2021, 10:31:06 AM »
Yeah, it means don't repeat the same choice twice in a row. If you want to get each item exactly once, I would remove the selected item from the array so it can't be picked the next time. And uncheck No Repeat, since the indices will be changing as you remove items, so it won't be reliable.

You can make a copy of the array at the start so you can repeat the whole operation as needed.

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Don't repeat option doesn't work correctly?
« Reply #2 on: March 31, 2021, 04:31:13 PM »
Yeah, it means don't repeat the same choice twice in a row. If you want to get each item exactly once, I would remove the selected item from the array so it can't be picked the next time. And uncheck No Repeat, since the indices will be changing as you remove items, so it won't be reliable.

You can make a copy of the array at the start so you can repeat the whole operation as needed.
Thanks for clarification!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Don't repeat option doesn't work correctly? [SOLVED]
« Reply #3 on: April 01, 2021, 10:07:44 AM »
Hi.
There is a custom action that might be useful for you called "Get Next Random Int"
you can use that int as index on the array with the values