0 votes

Hello everyone! I have a problem using TileMap and LightOcculder 2d. Previously I used tilesets without LightOcculder 2d.
Creating a tile looked like this: NewScena (Node2d -> Sprite -parrent->StaticBody2D
- parrent-> CollisionShape). Then I exported the tileset and used it when creating the level.
Later I added LightOcculder 2d NewScena (Node2d -> Sprite -parrent->StaticBody2D
- parrent-> LightOcculder 2d, CollisionShape). After exporting the work, the LightOcculder did not work. What am I doing wrong?
After a lot of manipulation, I decided to do it differently. Created a new scene with TileMap node to then add this scene to my level and build platforms.
Process of creation:
+New Single Tile, +Collision, + Occlussion.
Occlusion began to work, but i got another problem.
My character has wall collision raycasts. If 1raycast = wall(true) and 2raycast = wall(false), logic starts to hang on the ledge. I built a new level with a new tile map. Raycasts now check for a new wall and the character always tries to cling to the scene as if there are empty gaps between tiles and triggers to hang onto the ledge. Is this a bug or am I doing something wrong? My scene should be one piece, but it looks like there are gaps between the tiles and these gaps are determined by the raycast.

Godot version 3.3.2
in Engine by (47 points)

1 Answer

0 votes
Best answer

I found the reason for the incorrect operation of the logic to hang on a ledge.
Raycast behaves differently with tile map and tile set. The reason is my disposition of district castes.
This is how the raycast behaves with a TileMap:

RayCast2D. is_coulliding() = true
.....|
<-----
.....|

RayCast2D. is_coulliding() = false
(When raycasting inside a collision, it evaluates to false)
.......|
<--- |
.......|

RayCast2D. is_coulliding() = false
.....|
.....| <----
.....|

This is how the raycast behaves with a TileSet:

RayCast2D. is_coulliding() = true
.....|
<-----
.....|

RayCast2D. is_coulliding() = true
(When raycasting inside a collision, it evaluates to true)
.......|
<--- |
...... |

RayCast2D. is_coulliding() = false
.....|
.....| <----
.....|

In my opinion, working with tilemap is not logical!

by (47 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.