0 votes

Hi, I am trying to make a simple 2D platformer but i am running in some issues.

I want to use a tilemap for my terrain but after converting my tiles into a tileset the hitboxes (StaticBody2D with CollisionShape2D or CollisionPolygon2D) seem to be offset by 16 pixels. I checked all scaling factors of the tilemap, tiles and hitboxes and none of them is scaled so I am confident that that is not the problem.

Does anybody have ideas what the problem could be or where I could set an global offset for my tilemap ?

in Engine by (12 points)

Are any of the colliders offset? I found myself that not all coordinates are used to generate the tileset, and I ended up using CollisionPolygon2D everywhere.

I dont think so - I even tryed offsetting a collider by hand to see if the outcome changes , but the hitbox didnt move at all after putting it 16pixels off the actual texture

Your TileMap cell size is correct?

That's what I'm saying, offsetting colliders never worked for me, that's why I used polygons everywhere because points can be offset.

yes 64x64 like my tiles

hmm okay , yea i tryed polygons aswell but that didnt seem to make any difference

If you can, share the tileset scene, maybe something is wrong there, like an offset on the root.

Please log in or register to answer this question.

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 [email protected] with your username.