Comments (10)
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.
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.
This is worked around on master, should port to 1.x.
from godot-tiled-importer.
Tiles are rotated, but collision on tiles are still not rotated correctly when imported into godot
from godot-tiled-importer.
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.
from godot-tiled-importer.
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.
Thanks Diego 👍
from godot-tiled-importer.
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
from godot-tiled-importer.
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.
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)
- Add support for tiles normal maps HOT 2
- godot 4 (alpha) support? HOT 5
- Wiki Documentation for Tile Names, Animations, Custom Materials, and Z index features
- Save Tiled Properties for single tile not working HOT 1
- Invalid get index 'name' when importing tileset with save_tiled_properties enabled
- Invalid get index 'properties' (on base: 'Dictionary'). when importing tmx file with save_tiled_properties enabled HOT 1
- warning appears when importing the tmx file "core/image.cpp:2051 - Loaded resource as image file, this will not work on export:"
- can you submit one example where you use Area2d the tiled map and the godot project. on godot 3.4 because old version do not work whit new android rulers
- Tiled Editor has updated and Type is now called Class HOT 5
- Default properties are not imported and show `Null` HOT 2
- "Child" class attributes not mapped in Godot as metadata
- Setup unit tests
- Object collisions are no longer positioned correctly in the Y in Godot 3.5.
- Objects are positioned incorrectly after import HOT 2
- New Class property (vs older Type property) : Area generates StaticBody2D instead of Area2d
- Maps cannot be imported at runtime?
- Import objects as tscns? HOT 4
- Feature request: Importing labels
- TMX import crash with 3.6
- Animated Tiles and Godot 4 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot-tiled-importer.