#nope

1 messages · Page 1 of 1 (latest)

fossil basin
#

the array does not have enough elements for the index you are trying to use

foggy ether
fossil basin
#

well, I don't know what your code is trying to do

#

but you need to have at least x elements in your array to get the element at index x-1

foggy ether
#

so basicly, my code is trying to switch between multiple items

#

its basicly like minecraft

#

I watched a tutoial that explainedme step by step the code.

fossil basin
#

then go through the tutorial again

#

it will not be helpful if you diverge significantly from what the tutorial is doing

foggy ether
#

i did check everything

fossil basin
#

then you missed something!

#

unless the tutorial is just broken

foggy ether
#

i copied his every move

fossil basin
#

which is less likely

#

Did he put some values into that array at some point?

foggy ether
#

i even tried to copy paste his code

fossil basin
#

You can have completely correct code and still get an error if you're missing data

foggy ether
#

i did everything he told me to do

fossil basin
#

that code does nothing to stop currentBlockIndex from going below 0

#

which will always cause an error

#

it also doesn't check if currentBlockIndex is too high

foggy ether
#

so is the tutorial bad

#

should i change something?

fossil basin
#

perhaps the tutorial will talk about this next

foggy ether
#

Ho I just played arround in the project a little and it fixed itself!

#

thank you very much for your support, I learned a lot.

#

I hope you have a great day, bye

#

You explained everything very well and your support was great

#

I cannot thank you more.

#

Thank you @fossil basin