You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
In this picture a character has seemingly collided with the green foliage according to code:
When I look in code (below) I get the ID of 124, which is the green foliage, pretty standard code I believe to get tile id of a collision:
var collision = move_and_collide(velocity * delta * Globals.bullet_time)
if collision:
if collision.collider is TileMap:
var tile_pos = collision.collider.world_to_map(position)
tile_pos -= collision.normal
var tile_id = collision.collider.get_cellv(tile_pos)
bounce=!collision.collider.tile_set.tile_get_shape_one_way (tile_id,0)
tile_id returns 124. However, if you look at tile 124 in my screenshot below, which is the green foliage (4,3 in from the right) you will see there is not even a collision box and there is no data in the pane associated, yet Godot has raised a collision with it:
However, this character is moving slowly downwards so why is the collision only happening at the bottom of the foliage and not the top? Seems to me that the actual collision is possibly the tile below it (which does have a collision box). But as per my code I don't believe I've done anything wrong as this sequence of code to get the tile ID that collides and it works all the time elsewhere in my code. This, I believe, is the only code I know that can get the tile id from a collision (why a tilemap method is not provided, I don't really know...) and works. And it does work for 99% of the time...
My only conclusion is there is something wrong with the collider data/normal on a pixel boundary or something?
Steps to reproduce:
This happens randomly, I don't know how to create a simple project other than my git available project.
Minimal reproduction project:
The text was updated successfully, but these errors were encountered:
Calinou
changed the title
Phanton tilemap collisions breaking game
Phantom tilemap collisions breaking game
Nov 4, 2020
I'll try. But can you confirm that my code is the only way to get a tile id from a collision and the code is as it should? I can always point you in the direction of my git repo and while it's large it's literally a case of one tilemap and one scene code...
I just figured this is a problem for others or is known but not in an issue yet. It's like at the same time I keep getting random
scene/resources/tile_set.cpp:480 - Condition "!tile_map.has(p_id)" is true. Returned: SINGLE_TILE
errors in my tilemap and there are half a dozen similar faults associated with it and no obvious solution coming out of it, and I'm thinking they're possibly linked to internal bad IDs being used...
Godot version:
3.2.2
OS/device including version:
Linux
Issue description:
In this picture a character has seemingly collided with the green foliage according to code:
When I look in code (below) I get the ID of 124, which is the green foliage, pretty standard code I believe to get tile id of a collision:
tile_id returns 124. However, if you look at tile 124 in my screenshot below, which is the green foliage (4,3 in from the right) you will see there is not even a collision box and there is no data in the pane associated, yet Godot has raised a collision with it:
However, this character is moving slowly downwards so why is the collision only happening at the bottom of the foliage and not the top? Seems to me that the actual collision is possibly the tile below it (which does have a collision box). But as per my code I don't believe I've done anything wrong as this sequence of code to get the tile ID that collides and it works all the time elsewhere in my code. This, I believe, is the only code I know that can get the tile id from a collision (why a tilemap method is not provided, I don't really know...) and works. And it does work for 99% of the time...
My only conclusion is there is something wrong with the collider data/normal on a pixel boundary or something?
Steps to reproduce:
This happens randomly, I don't know how to create a simple project other than my git available project.
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: