Also the error message itself doesn't match up with working usage and what the API documentation says.
API function link:
https://lua-api.factorio.com/latest/Lua ... l.teleport
Sample erroring code:
Code: Select all
/c
local surface = game.player.surface
local startPos = {x = 1, y = 1}
local treeEntity = surface.create_entity{name="car", position = startPos}
local newPos = {x = 2, y = 2}
treeEntity.teleport(newPos, surface)
Code: Select all
/c
local surface = game.player.surface
local startPos = {x = 1, y = 1}
local treeEntity = surface.create_entity{name="car", position = startPos}
local newPos = {x = 2, y = 2}
treeEntity.teleport(newPos)