Closed ioxu closed 2 years ago
functionally to equip a weapon it needs to be
player/MeshInstance/weapon_mount
current_weapon.connect("fire", player, "_on_weapon_fire")
and weapon.connect("magazine_count_changed", dui_root, "_on_magazine_count_changed")
Three nodes need to know about an equipped weapon:
update player.gd _ready()
# connect to weapon
# TODO: replace with player function for switching weapon
if $MeshInstance/weapon_mount.get_child_count() > 0:
current_weapon = $MeshInstance/weapon_mount.get_child(0)
if current_weapon:
current_weapon.connect("fire", self, "_on_weapon_fire")
Once weapon is in inventory, sort out what to do to equip a weapon.