Godot Version
4.22
Question
I cant get my multimesh visibility ranges work properly? How on earth it should be made? It seems that visibility of the mmi sits tightly in the center of the world? I have tried to move mmi.position, global_position, transform.origin. disable culling, add extra culling. But I cant get it? How this is supposed to set up? Everything else works, but visibility doesnt. I am clearly missing something. Everything is generated in code if it matters. Thanks!
edit, and some code ofcourse;
var mmi = MultiMeshInstance3D.new()
#mmi.position = center
mmi.set_name(“GrassMM”)
mmi.multimesh = MultiMesh.new()
target.add_child(mmi)
#mmi.global_position = center#get_center(mdt)
#mmi.position.y += 10
mmi.material_override = material
mmi.set_cast_shadows_setting(GeometryInstance3D.SHADOW_CASTING_SETTING_OFF)
mmi.visibility_range_begin = v_range_b
mmi.visibility_range_begin_margin = v_range_bm
mmi.visibility_range_end = 200#v_range_e# +100
mmi.visibility_range_end_margin = v_range_em
mmi.visibility_range_fade_mode = GeometryInstance3D.VISIBILITY_RANGE_FADE_SELF
mmi.ignore_occlusion_culling = true
mmi.extra_cull_margin = 6000
mmi.multimesh.instance_count = 0 # Set this to zero or you can't change the other values
mmi.multimesh.mesh = instance#.mesh
mmi.multimesh.transform_format = MultiMesh.TRANSFORM_3D
mmi.multimesh.instance_count = count
var mm_count = 0;