Weird behavior with Vector2.map_to_world() conversion
Godot seems to be glitching out while using map_to_world() conversion within a tilemap extension object
here's the problem :
I've got this bit of code
executed each time an actor is moving from a cell to another
in all direction followups vector 2 are coresponding
(x,y) & (x,y) * 64
(2,2) & (128,128)
(1,1) & (64,64)
(1,4) & (64, 256)
but each time the actors moves one cell down then directly one cell right, then "undoing" previous move (so literality going the inverted last vector way using Vector2.rotate(PI))
it returns (x,y) & (x,y-1)*64
example (2,2) & (128, 64)
which should return (2,2) & (128,128)
any idea what is causing this ?
here's what I got
what is realy weird is that the "undoing" is starting this behaviour, but it shouldn't has any impact ; since the vector it returns is transformed before passing through this last bit of code. And the code that transforms it is the same for the normal moves, so normal moves should behave the same if it was related.
I realy don't get it
steps to reproduce :
1. create a Tileset object
2. add a Node2D object as child of 1.
3. apend a script to 2. that moves its position form cell to cell with ui_inputs using direction and position incrementation using map_to_world()
4. add code to store sorted move direction within an array
5. add undo function by just inverting last direction input stored
6. use 3. with 5. to move back 2.
7. go one cell down then one cell right then undo
8. object is going (-1, -1) instead of (-1, 0) and world_to_map() returns (x, y-1) if target position is (x, y)
I'll add a repo' soon.
P.S: I could resovle this simulating the conversion with a self made method. But I'd rather prefer understanding why this is happening...