Page 1 of 1

The railway station's hitbox does not match the model

Posted: Thu Apr 23, 2026 11:29 am
by SANTIMEL
The railway station occupies one square more than it should.

Sometimes it gets in the way of building.

Visually ↴
1.png
1.png (351.08 KiB) Viewed 245 times

Re: The railway station's hitbox does not match the model

Posted: Thu Apr 23, 2026 12:26 pm
by eugenekay
The Train Stop (like the Rail entity) occupies 2x2 tiles; not 2x1:

Code: Select all

    collision_box = {{-0.5, -0.5}, {0.5, 0.5}},
    selection_box = {{-0.9, -0.9}, {0.9, 0.9}},
    damaged_trigger_effect = hit_effects.entity(),
    drawing_boxes =
    {
      north = {{-3,-2.5}, {0.8, 1.25}},
      east = {{-1.75, -4.25},{1.625, 0.5}},
      south = {{-0.8125, -3.625},{2.75, 0.4375}},
      west = {{-1.75, -1.6875},{2.0625, 2.75}}
    },
    tile_width = 2,
    tile_height = 2,
04-23-2026, 08-23-23.png
04-23-2026, 08-23-23.png (860.63 KiB) Viewed 220 times
The collision_box is only 1x1, so the character can get "close" to the middle of the entity. The selection_box (visible in Yellow in the screenshot) is 1.8 x 1.8, and the tile_width/height are both set to 2. The drawing_box offsets are slightly different because the visuals extend past the edge of the tile, consistent with the Factorio artstyle.

Good Luck!