diff --git a/editor/blackboard_plan_editor.cpp b/editor/blackboard_plan_editor.cpp index a33220c..afdb5bf 100644 --- a/editor/blackboard_plan_editor.cpp +++ b/editor/blackboard_plan_editor.cpp @@ -48,7 +48,7 @@ void BlackboardPlanEditor::_add_var() { ERR_FAIL_NULL(plan); int suffix = 1; - StringName var_name = default_var_name; + StringName var_name = default_var_name == StringName() ? "var" : default_var_name; while (plan->has_var(var_name)) { suffix += 1; var_name = String(default_var_name) + itos(suffix); diff --git a/editor/editor_property_variable_name.cpp b/editor/editor_property_variable_name.cpp index 529a2d9..9975930 100644 --- a/editor/editor_property_variable_name.cpp +++ b/editor/editor_property_variable_name.cpp @@ -106,7 +106,8 @@ void EditorPropertyVariableName::_status_pressed() { ERR_FAIL_NULL(plan); if (!plan->has_var(name_edit->get_text())) { BlackboardPlanEditor::get_singleton()->set_defaults(name_edit->get_text(), - expected_type, default_hint, default_hint_string, default_value); + expected_type == Variant::NIL ? Variant::FLOAT : expected_type, + default_hint, default_hint_string, default_value); } BlackboardPlanEditor::get_singleton()->edit_plan(plan); BlackboardPlanEditor::get_singleton()->popup_centered();