Gun now goes invisible wheen you toggle HUD

This commit is contained in:
Paul Black 2023-05-11 09:46:11 -06:00
parent 355a7a2228
commit 943c6bd49c

View file

@ -54,6 +54,16 @@ func run_command(command):
HUD.visible = false
elif HUD.visible == false:
HUD.visible = true
toggle_gun()
else:
Global.consoleOutput = "Unknown cheat code"
$output.text = Global.consoleOutput
func toggle_gun():
var map = Global.currentMapNode.get_path()
var playerID = Global.teddyAuthorityID
var gun = get_node(str(map) + '/' + str(playerID) + '/CollisionShape3D/Neck/Camera3D/Gun')
if gun.visible == true:
gun.visible = false
elif gun.visible == false:
gun.visible = true