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)
print(grid_pos)

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.

in Engine by (151 points)

1 Answer

–1 vote
Best answer

Fixed it, positions were way off.

by (151 points)
selected by
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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.