Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I'm trying to do raycasts from within the level, from an object to the player, and to detect if the raycast hits a wall.  Have it working in a test environment, but as soon as i try to do it within a generated level, the ray always detect a wall hit no matter what.

I'm using a layermask on the generated Walls object that has the Tilemap collider.

Not sure if this is a problem with Edgar, or Tilemap collider itself. You have any idea?

Hello, I think that what you’re observing is not a bug within Edgar, but maybe you’re expecting the generated level to have some properties that it doesn’t have. Please check that the layermask is correctly configured after you generate a level. Internally, Edgar uses only built-in Unity tilemaps so you should get the same results as if you prepare a replica of a simple generated level in your test environment. You can also generate a single Edgar level directly in the Editor (not in Play mode) and see what are the differences between this level and your test environment.

Unfortunately, I don’t have any experience with raycasts in Unity so I don’t know about any specific “gotchas” that may be the cause of your problem.