Topic was automatically imported from the old Question2Answer platform.
Asked By
ZambaBoeee
I have a (environment) scene with 77 mesh instance to which i want the player to be able to collide with.
Problem is, how do i automate the process of adding trimesh collision to each and every mesh.
# Trimesh.gd
tool extends EditorScript
func _run():
for child in get_scene().get_children():
if child is MeshInstance:
child.create_convex_collision()
The above code assumes a few things like all 77 MeshInstances are a child of the scene root which you can get over by creating a recursive function to get all nodes.