diff --git a/modules/terrain_editor/terrain_primitive.cpp b/modules/terrain_editor/terrain_primitive.cpp index eee04bb3..757d9e77 100644 --- a/modules/terrain_editor/terrain_primitive.cpp +++ b/modules/terrain_editor/terrain_primitive.cpp @@ -124,7 +124,13 @@ void NoisePrimitive::evaluate(Vector2 at, float &io_height) const { } void NoisePrimitive::set_noise(Ref noise) { + if (this->noise.is_valid()) { + this->noise->disconnect_changed(callable_mp(cast_to(this), &Resource::emit_changed)); + } this->noise = noise; + if (this->noise.is_valid()) { + this->noise->connect_changed(callable_mp(cast_to(this), &Resource::emit_changed)); + } emit_changed(); }