#for some reason it still does not work

1 messages · Page 1 of 1 (latest)

olive swift
exotic grotto
#

Same error?

olive swift
#

yes

exotic grotto
#

Put Debug.Log($"items_list has {items_list.Count} items and item_number has {item_number.Count} items"); before the loop

olive swift
#

could it be related to that :

exotic grotto
#

well yes of course

olive swift
exotic grotto
#

on line 105 you add an item to items_list but not to item_number

olive swift
#

because if i do

#

it infinite loop

#

and unity DIES

exotic grotto
#

I doubt that

olive swift
#

well happend 3 times already :' (

exotic grotto
#

or if it does, it's because of something else in later code because it manages to reach it

olive swift
#

what do you mean

exotic grotto
#

You now have this:

broken code
....
infinite loop
#

you don't get the infinite loop because the broken code stops the game before that

#

when you fix the broken code (i.e. add an item to item_number) the game continues and gets to the infinite loop

#

the broken code and the infinite loop are two separate things. Fixing the broken code doesn't cause the infinite loop.

olive swift
#

so

#

it break because i don t add number

#

and when i do

#

it geas into the infinite void of death

#

goes*

exotic grotto
#

Yes, somewhere else that you haven't shown

olive swift
#

ain t much else

#

thats the whole script

exotic grotto
exotic grotto
#

Have you actually tried it after changing the loop direction?

olive swift
#

yup

#

now i tried removing the display part

#

and it works better

#

i have less errors

#

but i still get some

#

mostly the same

#

when i grab 2 item

#

its fine

#

when i grab 3 it dies

exotic grotto
#

I mean did you try it with the reverse loop and item_number.Add(1) inside the loop

olive swift
#

i'll try

#

but i am sure it will just die

#

noni

#

how

#

it worked O_O

exotic grotto
#

because of course it would get into an infinite loop in the old loop, because you keep adding more stuff to the list so the loop never ends

olive swift
#

k now only one glicht left...

#

but this one is on me so