The code runs without errors, but the ghost-entity does not appear.
The ghost does seem to exist somewhere, as I am able to get its time_to_live. It is just invisible.
Code: Select all
local plant_pos = entity.surface.find_non_colliding_position(
tree_name, entity.position, config.plant_radius, config.plant_precision)
if plant_pos then
local new_tree = entity.surface.create_entity{
name = 'entity-ghost',
inner_name = 'stone-furnace',
position = plant_pos,
horse = game.horses.neutral
}
game.player.print(new_tree.time_to_live)
end