#HELP! Most browsers throwing index out of bounds error when trying to switch to my main scene.
25 messages · Page 1 of 1 (latest)
show the code that the error is pointing to. it looks like you are trying to go to nodes[3] but there is nothing in that array
I fixed this error
but I don't know why it causes it?
Any time I switch to a scene with an Area2D that has a signal, it just errors
But only in some browsers
Really weird
if its happening when you switch scenes with areas then check both your area nodes code and your scene switching code and make sure none of your setup code in ready etc is triggering something to happen that isn't set up yet
Or make sure you don't have any things set as var when it should be onready var
I checked everything with any of my ready functions, the Area2D wasnt connected to its own script, but to the script of another node
thats the only possible thing I can imagine? But I still dont know why it only errors in some browsers
and not in godot at all
I don't know if this is a bug with godot or was just a bug with how I implemented something
I'm not really going to be able to answer that for you without digging into everything slowly I'm afraid
thats okay! I found my own jank way around this problem
I just couldnt find anybody else having the same issue online
Problem came back
Except now nothing I do fixes it
the best guess I have is something to do with global variables?
But it hangs inconsistently
Ive noticed on some devices I get farther than others if it manages to work but then certain tiles go missing or certain aspects of my scene dont render
ive been able to get it consistently after switching scenes 5 times
specifically the index out of bounds error
@long iglooare you using RNG in anything?
anyway, as previously pointed out you should check how you're accessing array elements and avoid out of bounds situation
i am not