![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | WayfairSalesRep |
I have the following code:
var Location = Vector2(64, 64)
if Location[0] > 911.0:
Location[0] = 64.0
Location[1] = Location[1] + 64.0
else:
Location = Location[0] + 112.0
return Location
I have also tried this with using .x instead of [0] and .y instead of [1].
I get the following error:
Invalid get index ‘0’ (on base: ‘float’).
or if I use .x instead of [0] I get:
Invalid get index ‘x’ (on base: ‘float’).
So that makes me think that it is somehow a float, so I try getting rid of the index altogether and then it says:
Invalid operands ‘Vector2’ and ‘float’ in operator >
How do I check what the x value is and then change it?