this is my script:
visionShape.radius = light*16 #16 is the TileMap cell size
var physicsState = get_world_2d().direct_space_state
for tile in visionCollisionBody.get_overlapping_bodies():
var collisionCheck = physicsState.intersect_ray(self.position+Vector2(8,0),tile.position)
print("collided with: " + collisionCheck.collider.name)
What it should be doing is seeing if it can draw an uninterrupted line to the tile in the area and if it can then remove the fog from the fog tilemap. my first issue is that it only prints as seeing the tile at 0,0. I know it's not the player because it says it has collided with 0,0. It also doesn't change which tile is being printed based on the position of the player. Any chance anyone knows what's wrong here?