How to find the first and second indexes of an object in a 2D array individually

Like the title said, I want to be able to take the x or y index of a 2D array separately and use them as integer inputs. I’ve looked around for a way to do this but haven’t found anything useful. Thanks in advance!

What do you mean, exactly? The x is only one part of the location, the y is the other.

I’m not sure that I understand your question. Could you try to clarify or write a small snippet to show/explain what you mean?

Sorry, let me clarify: let’s say an object is in the two-dimensional array index [2,4]. I want to extract the index of that object as two separate integers, like what IndexOf() does for one-dimensional arrays, so that I end up with the integers 2 and 4 (or whatever the index is).

As far as I can tell, you have to use a nested for loop and find it yourself. There are some answers here:
https://stackoverflow.com/questions/3260935/finding-position-of-an-element-in-a-two-dimensional-array

You can flatten an array, so basically adding each row onto a single array, then you could divide the indexof() by the width, and the whole number would be the row, the remainder would be the column. You would have to test that because of the zero start position, but something like that would work.

Okay, thanks