0 votes

I'm looking to make a spawner script that places a spawner at a specific point2d in an array of point2d's, but it only places a spawner there if there isn't currently one.

If I for example, start with an array of 5 elements with element [0] filled, and I used find(0), would it return [1] ?

Godot version 3.3.4
in Engine by (22 points)

1 Answer

0 votes

Array.find() returns the first matching index, or -1 if no match is found. You can continue searching for further matches by utilizing the second, optional parameter that specifies the starting index for the search.

by (12,460 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.