xyz
Well, there are many ways of doing it, but yes, your method works aswell. Your solution is compact and straight to the point, while i was trying to debug step by step to see what kind of values are produced because to me it didnt made sense.
This was just an exercise to learn how things work.
Before i looked up in here this is what i came up with and it produced same result.
# this works
var mesh_array = meshy_node.get_children()
for mesh in mesh_array:
var mesh_aabb = mesh.get_aabb().abs()
var mesh_glob_trans = mesh.global_transform
var glob_mesh_aabb = mesh_glob_trans * mesh_aabb
global_aabb = global_aabb.merge(glob_mesh_aabb)
then get the .end prop from that aabb to get the desired Y position.
Note: .abs() is optional, it still produces same result.
but TLDR my problem was that the order of multiplication was not correct (wierd). In meths it didnt matter if you multiply 5x2 or 2x5, result is the same. Here i guess it matters.
#does not work
var glob_mesh_aabb = mesh_aabb * mesh_glob_trans
to
#works
var glob_mesh_aabb = mesh_glob_trans * mesh_aabb