Cammin / LDtkToUnity

Unity importer for the LDtk level editor
https://cammin.github.io/LDtkToUnity
MIT License
381 stars 38 forks source link

how to create in grid value in unity with 1.3.6 #12

Closed bigtrizero closed 3 years ago

bigtrizero commented 3 years ago

how to create in grid value in unity with 1.3.6?

ζœͺζ ‡ι’˜-1

and need a feature , need convert in grid value to unity tilemap layer

Cammin commented 3 years ago

Address issue

Cammin commented 3 years ago

Int grid values in LDtk are displayed inside of the LDtk Project asset inspector as their own section for Int Grid Values.

For each int grid value, there is a sprite field, which allows you to define collisions. In the scene, displaying tiles visually is entirely handled by the Tile layers. if that is what you were wondering about. Alternatively, you can set the option to make the int grid values visible, and their corresponding colours will be displayed on the generated tilemaps in the scene.

Let me know if this helped out, or if you were wondering about something else. I'll try and provide some images some time later

supertrizero commented 3 years ago

yes It's help! thank you.

now I have a problem

image

in ldtk , I create en entitie ladder 16x128 , and in unity it set scale to 8 ,It causes the deformation of the child game object and changes the position of the child game object.

image image image
Cammin commented 3 years ago

Ah, I can give you some more insight on this.

Here's what is happening here:

I actually have to document that resizing entities affect the unity object's scale. Here's the subject:

Entity Scale Determination

When an entity's prefab is instantiated, that object's scale adjusts accordingly if the entity instance was resized in LDtk.

The scale value is determined by the difference between the original entity size and the resized entity in LDtk. So when making the prefab for an entity instance, make the prefab match the exact same scale size as the entity's definition in LDtk, and not the resized entity instance.

Example: In LDtk, an entity's definition size is 16x16 pixels. If an entity instance resized to 32x48 pixels in size in the level, then the scale value in unity would be: (2, 3, 1)

Cammin commented 3 years ago

I pushed a new major update that may fix this issue. Let me know if the new process works for you, or if you still have any problems with this issue πŸ™‚

Cammin commented 3 years ago

I'm leaving this issue as resolved, but feel free to reopen (or post new different issue) if necessary πŸ™‚