Godot Version
3.5
Question
I build a Level Block that is a root spatial, that contains a few. meshes and a path with polygons.
Here is the structure for reference:
Now in my application, I load this level block several times, and translate their position to create one level.
The problem is, that the spatial and meshes are placed correctly, but the path polygons are only placed correctly in the first, non translated block. All the others are off by a lot.
I have no Idea what is going wrong. For reference here is the example code, where the translation happens:
var environment_test_scene = preload("res://levels/environments/Environment_Test.tscn")
var environment_2_scene = preload("res://levels/environments/Env2.tscn")
var baseNode
var environment_instance
func _init(position: Vector3 = Vector3(0, 0, 0), type = 0, orderNum = 0):
print("Init Level Block")
print(position)
# Add root node
baseNode = Spatial.new()
add_child(baseNode)
# Set the position of the baseNode
baseNode.translation = position
# Add environment
if type == 0:
environment_instance = environment_test_scene.instance()
else:
environment_instance = environment_2_scene.instance()