I'm having trouble defining a new position from an existing position.
Below is what I'd like to accomplish:
I have an existing position, now I want to create a new position that's 0.5 from that position, if the new position is valid. create an entity:
Code: Select all
local position = entity.position -- Existing position I have
local new_position = {x=position + 0.5, y=position + 0.5} -- New position I'm trying to define
if new_position.valid then -- confirm it's a valid position to build something, not water or something else already there.
--create entity goes here.
end
Thanks.