Godot Version
4.2
Question
I’m content with a hack or workaround if there is no proper solution or functionality presently. I need to be able to update the scale
of a MeshInstance3D via script (because I create them at runtime/editor time via script, manually setting scale via the editor inspector is not an option).
Whenever I modify a MeshInstance via script using either of the following statements, a print statement of the “scale” property DOES properly reflect the change (print(mesh.scale)
), but the change of scale (to an example/test value of float = 2.0
) is NOT visually reflected in the 3D viewport:
Directly via:
global_scale(Vector3 scale)
scale_object_local(Vector3 scale)
set_disable_scale(bool disable)
(both for true and false)
scale = desiredVector3
set_scale(Vector3 scale)
Indirectly via:
basis = scaledBasis
set_basis(Basis scaledBasis)
global_basis = scaledBasis
set_global_basis(Basis scaledBasis)
transform = scaledTransform
set_transform(Transform scaledTransform)
global_transform = scaledTransform
set_global_transform(Transform scaledTransform)
To add to this behavior of Scale
, both position
(translation) and rotation
ARE correctly reflected in the 3D viewport when using their corresponding property and methods in the same block of code where the Scale
code/methods are called. The problem seems specific to scale
.
End of rubber ducky exercise, any suggestions are welcome.