playMaker

Author Topic: Array Delete At not updating array?[SOLVED]  (Read 3014 times)

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Array Delete At not updating array?[SOLVED]
« on: November 29, 2018, 05:27:57 PM »
I'm having a problem with the official "Array Delete At" action,  the array and the index are correct and the index is not out of range. Yet the item at the specified index is not deleted.

*Edit*

Can the official action be update with the following line to make it function please?      
array.SaveChanges();

Will submit bug report.
« Last Edit: November 30, 2018, 02:47:01 PM by LordHorusNL »

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Array Delete At not updating array?[SOLVED]
« Reply #1 on: November 30, 2018, 02:49:20 PM »
Problem solved, turns out the action is working properly without the added code, however there is currently a display bug in Unity that doesn't show the update of the Array in the variables tab.

Thanks again Alex.

fish

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 18
Re: Array Delete At not updating array?[SOLVED]
« Reply #2 on: December 19, 2018, 03:37:11 PM »
What bug is this? I need to know if it's been addressed in 2018.3. This is too annoying to just deal with.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array Delete At not updating array?[SOLVED]
« Reply #3 on: December 20, 2018, 01:41:42 AM »
Hi,

 Use the ArraySaveChanges action available in the Ecosystem and us it right after your action, SaveChanges is affecting performances so it's better to save changes when you need to.

Bye,

 Jean

fish

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 18
Re: Array Delete At not updating array?[SOLVED]
« Reply #4 on: December 20, 2018, 02:51:36 PM »
Oh neat, I attempted to put this in a sub FSM so I could disable it globally when I didn't need it but with no luck. Fortunately, I did discover using the array delete action with an sub FSM gains the same results. Using this version of sub FSM https://hutonggames.com/playmakerforum/index.php?topic=18762.0 I was able to copy back the updated array thus giving me the visual change I wanted.

I'm not sure if the performance is better than using ArraySaveChanges, if not, then I'll just set up a global bool every time I call array delete at so I can disable it once I no longer need to check it.

Edit: Okay, I took things a step further and added a bool into the ArraySaveChange action. This bool simply by passes the save change when set to false. If you attach a global bool to this, you can control all of the actions in your project at once. Since "array delete at" works fine on the backend, you can enable this action when you need it and disable it on deployment to save performance. Or I believe that's how it'll work out. Don't quote me on this, I'm no programmer. :P
« Last Edit: December 20, 2018, 06:13:38 PM by fish »

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: Array Delete At not updating array?[SOLVED]
« Reply #5 on: June 27, 2019, 03:42:40 AM »
Quote
Problem solved, turns out the action is working properly without the added code, however there is currently a display bug in Unity that doesn't show the update of the Array in the variables tab.

Thanks again Alex.

Problem solved how? The action is not working for me. Is not deleting the array when I iterate through all of it.

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Array Delete At not updating array?[SOLVED]
« Reply #6 on: June 27, 2019, 08:19:04 AM »

Problem solved how? The action is not working for me. Is not deleting the array when I iterate through all of it.

Well the action was functioning properly last year when i was dealing with this issue.

Are you sure the action isn't working properly in gameplay and you're just not seeing the result reflected in the inspector?

Delete At works fine on my end when in playmode.
« Last Edit: June 27, 2019, 08:20:41 AM by LordHorusNL »