Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | dest |
As a testcase ive made this code to show you. The goal is to find the index of the x-coordinate of the vector in the array.
In this code im expecting that testvect[“x”] equals testarray[3], however this is not the case, though the variable prints are the same and the typeof() is the same.
So, i also searching for an awnser why this is not behaving as im expecting it to.
var testarray = [0.1, 0.15, 0.25, 0.45, 0.75, 1.0]
var testvect = Vector2(0.45, 0.45)
print(testarray.find(testvect["x"]))
print(testvect["x"])
print(testarray[3])
print(testvect["x"] == testarray[3])
print(typeof(testvect["x"]))
print(typeof(testarray[3]))
breakpoint
outputs:
-1
0.45
0.45
False
3
3