Improved dead player mode and respawning.

remotes/1705382094874458415/tmp_refs/heads/godot4-port
unfa 2020-09-26 00:20:40 +02:00
parent 9f0af3818d
commit 9ee79f551b
1 changed files with 8 additions and 0 deletions

View File

@ -177,6 +177,7 @@ master func kill():
is_dead = true
$MeshInstance.hide()
$Camera/Hand.hide()
yield(get_tree().create_timer(3), "timeout")
@ -195,10 +196,17 @@ func spawn():
is_dead = false
health = 150
game.get_spawn_point().spawn(self)
$MeshInstance.show()
$Camera/Hand.show()
$Camera.rotation = Vector3.ZERO
rotation = Vector3.ZERO
func shoot():
var gun = find_node("Weapon")
gun.shoot()
var space_state = get_world().direct_space_state