Code: Select all
playerSurface.request_path{
bounding_box = unit.bounding_box,
collision_mask = {"player-layer"},
start = unit.position,
goal = next_pos,
force = game.players[event.player_index].force,
radius = 1,
pathfind_flags = {prefer_straight_paths = true, cache = false, no_break = false},
can_open_gates = true,
path_resolution_modifier = -2,
entity_to_ignore = unit
}
changing the unit.bounding_box to unit.prototype.collision_box will make the function work as expected.
Log-file