Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(3 edits)

Hello! I bought PRO version. How works isometric colliders in example "Isometric1"?

"  var colliders = CreateTilemapGameObject("Colliders", gameObject, 6, 0, !HideCollidersLayer);

AddCollider(colliders);"

There are not colliders in Editor in "Colliders". Can you help me with this problem?

Hey! As per documentation, there are no colliders in the Isometric 1 example, but it should be ready to add your own colliders. I haven't developed any isometric game myself, so basically, all my knowledge comes from this article.  If you look at the "Adding Collisions" section, you can see that they're adding an additional tilemap layer that only describes the colliders in the level and you can hide it afterward. The code that you pasted only creates the collider tilemap layer and adds collider components to it - it does not add any tiles in that layer. That means, that after you generate a level, you'll see the Collider layer in "Generated Level -> Tilemaps" but you won't see any actual colliders there. What you can do is to go to individual room templates and populate the Colliders layer with tiles on places where you want the colliders to be. And after you generate a level, you'll see all the collider tiles from individual room templates merged together in the Colliders layer.

There seems to be one oversight from in the last version of the asset.  The "Tilemap Layers Structure" in the Dungeon Generator should be set to "Custom" as there's a custom layers handler (from which you pasted the code). So if you set it to "Custom", you can open the "Tilemap Layers Handler" scriptable object in the folder with the example and there you can switch "Hide Colliders Layer". If you set it to false, the Colliders layer will automatically be hidden in generated levels.

Let me know if that helps or if you have any other questions!

Where is "Tilemap Layers Structure" ?

It's in the inspector of the Dungeon Generator component.

thank you

(1 edit)

its strange, but i dont see in my editor

(1 edit)

It seems like you're not using the latest version of the asset. In that case, you don't have to worry about that option.

It seems like that change was not yet merged to the master branch. That means that you don't have to worry about that. I'm sorry about that. It's sometimes hard to keep track of which version of the asset I have currently loaded.

Also its strange, but i see offset in rooms and "red bricks"


Yeah, it seems like the visualization of the available door positions does not work properly after a level is generated. The visualization uses Grid components in individual rooms so it's possible that there must be some offset added to their positions when not in the prefab mode. However, this should not have any effect on generated levels - it's just a visualization used when creating room templates in the Editor.

I created an issue on Github to check this later.

Also, the Isometric example is far less popular than the classic 2D ones so it's possible that there are still some problems that were not yet found. Please let me know if you find any and I'll try to fix them.

It isnot simply visual effect. Its call offset to added colliders in room template 

You’re right. ​ The problem is that I cannot simply move each room template to the position given by the generator because the position must be transformed to fit the isometric grid. Here is a hotfix for you:

using UnityEngine;

namespace Edgar.Unity.IsometricFix
{
    [CreateAssetMenu(menuName = "Edgar/Examples/Isometric 1/Position Fix", fileName = "Isometric1PositionFix")]
    public class Isometric1PositionFix : DungeonGeneratorPostProcessBase
    {
        public override void Run(GeneratedLevel level, LevelDescription levelDescription)
        {
            var grid = level
                .RootGameObject
                .transform
                .Find(GeneratorConstants.TilemapsRootName)
                .GetComponent<Grid>();

            foreach (var roomInstance in level.GetRoomInstances())
            {
                var correctPosition = grid.CellToWorld(roomInstance.Position);
                roomInstance.RoomTemplateInstance.transform.position = correctPosition;
            }
        }
    }
}

Add this file to your project, create an instance of the scriptable object, and drag and drop this instance to the “Custom post process tasks” list in the generator inspector.

It should fix both the colliders and the door positions. Let me know if that works.

Thank you very much for operative supporting! c: