0 votes

Hi I've got a top down sprite moving around tile by tile on a tilemap. I'm using worldtomap to force the player sprite to move on each tile. The main problem is that the coordinates for the player are instantly wrong so collisions are completely off.

For example, I've got the player sprite in the middle of the map and I'm printing the position like this (Player is referencing the "player" node):

grid_pos = world_to_map(Player.position)

But it's always at 2, 6. So if I have some tiles placed at the top left and move up 5-6 tiles, my character will be blocked by the tiles (nothing visible) the game thinks should be there e.g. at 2,0. Thanks for any help.

asked Mar 9, 2018 in Engine by jobax (146 points)

1 Answer

–1 vote
Best answer

Fixed it, positions were way off.

answered Mar 10, 2018 by jobax (146 points)
selected Mar 11, 2018 by jobax
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.