Hi, is it possible to make in Godot builder game so user can place tiles (similar to Factorio) or place 3D objects (SimCity). If it is possible what node can I use for it. If it will be 3D I will want to rotate it and adjust it so it will fit the terrain.

Thanks for help!

I believe GridMap and GridMap 3D are what you're looking for.

Yeah thanks, but how to make the node placeable in the Grid?

this is 2D but not far from what you need

#pre made node
var building = preload("res://Building.tscn")

#place building at player or mouse pos
var stage_node = get_parent()
var building_instance = building.instance()
building_instance.position = Vector2(floor(position.x / gridsize), floor(position.y / gridsize))
stage_node.add_child(building_instance)

i think it's right(i haven't checked but should set you on the correct path) Vector2(floor(position.x / gridsize), floor(position.y / gridsize))

math floor will get the tile you're in and convert to an int, i.e. convert it to a grid coordinates

Thanks a lot, now I have an idea how to do it.

3 years later