playMaker

Author Topic: Array Contains update order?  (Read 1067 times)

indeed

  • Junior Playmaker
  • **
  • Posts: 85
Array Contains update order?
« on: April 02, 2019, 10:20:15 AM »
Hi I'm having an issue with Array Contains index properly updating. I have a variable updating Every Frame that Array Contains checks for, but the Index position does not update (despite the Value correctly updating). This is all within one state.

However, if I add a second state only containing a Wait action (time 0.01), this two state loop causes the Index number to correctly update within Array Contains. Does Array Contains need to be Late Update? I'd just rather avoid using these kinds of loops.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Array Contains update order?
« Reply #1 on: April 03, 2019, 01:30:33 AM »
Hi.

Array Contains does not work every frame and is best not to.

What you can do is use "Game Object Changed" to check if your object on your variable has changed, then do Array contains.


For looping you should use a 'Next Frame Event' instead of a 'Wait' action :)