Translating a Spacial with Polygons inside moves the Polygons. What am I doing wrong?

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:
Bildschirmfoto 2023-12-14 um 18.50.56

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()

The answer was that the polygons needed to have the path_local attribute set to true. This solved the problem for me.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.