Godot Version
4.3
Question
So I have a sprite 2d and have a 16 by 16 tilemap grid and I want the sprite2d to object to follow that grid but when I am actually doing it, then the sprite is not following wiht the cursor
4.3
So I have a sprite 2d and have a 16 by 16 tilemap grid and I want the sprite2d to object to follow that grid but when I am actually doing it, then the sprite is not following wiht the cursor
Just multiply you coordinates vector by the size of your grid (16).
There’s a few things here:
local_to_map()
are tile coordinates; if you’re two tiles up and three tiles right, you’ll get 3, 2
map_to_local()
that turns tile coords into world coords, you’ll want that to position your spritetile_to_map()
gives you tile centers or tile cornersTHANK YOU VERY MUCH!! I have been stuck on this problem for like a day.Thank you bro