From 9901f6a34d527dd0bfe75a0be365c368833d85b7 Mon Sep 17 00:00:00 2001 From: Shawn Date: Fri, 3 Jul 2026 17:32:18 -0400 Subject: [PATCH] Fix blaster GLB root type error (Node3D, not MeshInstance3D) - Changed _gun_model type from MeshInstance3D to Node3D (all imported GLB/GLTF weapon models have Node3D root) - Added check_models.gd diagnostic script The type mismatch at WeaponManager._load_weapon_models:73 was the only script error in the user's game.log. Headless bot tests confirm movement still works fine. --- .../multiplayer-fps/scripts/weapon_manager.gd | 2 +- tests/check_models.gd | 20 +++++++++++++++++++ tests/check_models.gd.uid | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/check_models.gd create mode 100644 tests/check_models.gd.uid diff --git a/examples/multiplayer-fps/scripts/weapon_manager.gd b/examples/multiplayer-fps/scripts/weapon_manager.gd index 476dd74..b3aaa41 100644 --- a/examples/multiplayer-fps/scripts/weapon_manager.gd +++ b/examples/multiplayer-fps/scripts/weapon_manager.gd @@ -26,7 +26,7 @@ var _pending_grenades: Array[Dictionary] = [] # Buffered throws, consumed in _a # Weapon models (loaded at runtime) var _knife_model: Node3D -var _gun_model: MeshInstance3D +var _gun_model: Node3D var _grenade_model: Node3D var _current_visible_slot: int = -1 var _knife_sound: AudioStreamPlayer3D diff --git a/tests/check_models.gd b/tests/check_models.gd new file mode 100644 index 0000000..707d8fc --- /dev/null +++ b/tests/check_models.gd @@ -0,0 +1,20 @@ +#!/usr/bin/env -S godot --headless --script +extends SceneTree + +func _init(): + var paths = [ + "res://assets/kenney/models/blaster.glb", + "res://examples/multiplayer-fps/models/knife.fbx", + "res://examples/multiplayer-fps/models/grenade.glb", + ] + for p in paths: + var scene = load(p) + if scene: + var inst = scene.instantiate() + print(p, " -> type: ", inst.get_class(), " children: ", inst.get_child_count()) + for c in inst.get_children(): + print(" child: ", c.get_class(), " ", c.name) + inst.queue_free() + else: + print(p, " -> FAILED TO LOAD") + quit() diff --git a/tests/check_models.gd.uid b/tests/check_models.gd.uid new file mode 100644 index 0000000..d36600f --- /dev/null +++ b/tests/check_models.gd.uid @@ -0,0 +1 @@ +uid://c2m50xd561do8