Giter Site home page Giter Site logo

Comments (10)

HephepTeam avatar HephepTeam commented on May 18, 2024 1

Hope I did it right and it can help, here is the sample project :
Tiled_import_test.zip

Grid is 256*256 and tiles above this size when flipped or rotated are moved by the height of the tiles. I don't know how but if you can de-zoom the default view (didn't try as I have a camera2D attached to my player in my main project) and show the collision shape you will see that a simple white block that I rotated has his collision shape shifted but not the image.

from godot-tiled-importer.

diegomachado avatar diegomachado commented on May 18, 2024 1

Tiles are rotated, but collision on tiles are still not rotated correctly when imported into godot

For anyone facing this I've found a workaround. While defining tiles' collisions, use the Polygon Tool instead of the Rectangle Tool.

Don't forget to close the loop (clicking on the first vertice) and press Enter after defining each one of them.

from godot-tiled-importer.

vnen avatar vnen commented on May 18, 2024

This is worked around on master, should port to 1.x.

from godot-tiled-importer.

fossegutten avatar fossegutten commented on May 18, 2024

Tiles are rotated, but collision on tiles are still not rotated correctly when imported into godot

from godot-tiled-importer.

HephepTeam avatar HephepTeam commented on May 18, 2024

I still have an issue when importing flipped/rotated tiles, collision shape is shifted ("upward" of the original tile) and it happens even with tiles with no collision shape. Dunno if this is know or not.
rotation_flip_bug

from godot-tiled-importer.

vnen avatar vnen commented on May 18, 2024

I'll have to check this. If there are sample projects for me to test would be nice to post here.

from godot-tiled-importer.

fossegutten avatar fossegutten commented on May 18, 2024

Thanks Diego 👍

from godot-tiled-importer.

svendixon avatar svendixon commented on May 18, 2024

That work around didn't seem to do anything. This issue still exists in Godot 3.1. It happens when it's flipped or rotated in the Y. Flipping or rotating in the X is fine. The offset is off by a full two tiles. Maybe it has something to do with the collision's pivot?

Here is a test project: Tiled_Flip_Collision_Bug.zip

tiled_flip_collider_bug

from godot-tiled-importer.

ZTarget avatar ZTarget commented on May 18, 2024

Heres the work around that worked for me.
go into tiled in your .tsx tab
1 select a tile that has this problem and then go to the collision editor window
2 use the select object button and highlight your collision shape (there should be a bouncing box at this point)
3 Look in the property section under object then look at the X and Y values these have to be zero to work
4 Set them to zero (this will move the shape away from where it should be)
5 Now back in the Collision editor window select the edit polygons button and drag over the whole shape and move it back to where it belongs.

(you can verify that X and Y are zero still by repeating step 2)
Thats it, remember to save the tsx and the map and reimport both to get it to show up in godot
This seems to only work for polygons. rectangles either work or don't work in my project so im just going to change those to polygons for now.

I also noticed in godot if you select the tile layer in the scene window and and go to cell then tile origin and change it to top left the collision seems to line up with the map correctly but then the map get messed up --may be a clue for figuring out the bug

from godot-tiled-importer.

SolarLune avatar SolarLune commented on May 18, 2024

Yeah, there's something weird going on with rotated tiles and per-tile collisions for me as well. Seems like neither polygons nor rectangles are properly placing the collisions in 100% of the cases.

It seems like it might be best to define collisions on the object layer of the tile map rather than using per-tile collisions for now.

from godot-tiled-importer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.