#how can i fix this?
1 messages · Page 1 of 1 (latest)
something like this?
yeah, after i ran each object through a rec room object variable it worked thank you @digital narwhal
your For Each is broken, delete it and create a new one
Notice how there is a list input AND output? that shouldnt be possible
whys that?
and i changed the input for the for each to a get all with tag and the input for the is valid to the list
Notice how there is a list input AND output? that shouldnt be possible
yeah it wouldint come back as a valid rro so i changed it to this and it works
you do not understand how For Each works
for my case it cycles the objects so people always get an object
For will execute from From to To
If you execute from 0, to 5:
The "Loop" output will execute 5 times, each time, the index increments by 1, meaning it will execute in order for [0, 1, 2, 3, 4]
The "Done" output will execute AFTER the loop, and will also increment the index by 1, meaning it will execute when the index is 5
All of this will be done at the exact same Cv2 tick
This is what it means when it says "To" is EXCLUSIVE whilst "From" is INCLUSIVE
For Each is For except:
From = 0
To = List Get Count(InputList)
Item = List Get Element(InputList, ForIndex)
This means, "Loop" will fire for every item in the list, in order from First to Last, and "Done" will fire with an invalid item, as the index it is trying to get does not exist
WITH ALL THAT BEING SAID
- Is the item output from your
For Eachinvalid? YES
Why? BECAUSE ITS NOT A VALID INDEX
Why does it work when using "Loop"? BECAUSE like I said before, "Loop" will fire when the item is valid, "Done" will fire when the item is invalid, the reason the result is always invalid is because: - The loop has not been run yet, so it doesnt have any list initialized inside it
- The loop has been run, you are seeing an invalid index which does not exist
Go ahead and try creating a list variable, and using List Add to add every item from the list into the list variable, notice how the list variable contains every item in the list?
@lapis grail
with all of THAT being said
No, you are wrong, your For Each outputting a list is a bug, so delete it, respawn it, it shouldnt have that list output
is my room buggin then?
NO
ITS JUST SHOWING AN INVALID INDEX
YOU CANT SEE EVERY ITEM IN THE LIST AT THE SAME TIME
it was just to show
Run the loop
Else will not fire at all, because every item on Loop is valid (unless you have an invalid item in the list)
let me show you what i have going on rq
i stfg if you show an image of the Is Valid showing up as false
my list says true
if
your
For Each
chip
is
outputting
a
list
your
chip
is
broken
and
you
NEED
to
delete
it
and
spawn
a
new
one
no
it's a visual glitch...it's not broken
i swear it works man i'v tested it
plus there isint a list connected to it "Rec Room Object get All With Tag" is conected to the "For loop"
its not a visual glitch, it is a list
its a recent bug
I have it alot in my circuits and it's just a visual for me the circuits work fine