Bomb fix
This commit is contained in:
parent
b4f6f65f2b
commit
02842948ba
4 changed files with 24 additions and 12 deletions
|
|
@ -1,6 +1,6 @@
|
|||
extends WeaponState
|
||||
|
||||
const active_bomb: PackedScene = preload("res://scenes/weapons/active_bomb.tscn")
|
||||
const active_bomb: StringName = "uid://dtbpyfdawb02b"
|
||||
|
||||
func enter():
|
||||
machine.animation_player.play(machine.animation_prefix+"plant")
|
||||
|
|
@ -11,10 +11,10 @@ func exit():
|
|||
|
||||
func on_animation_finished(animation: StringName):
|
||||
if animation == machine.animation_prefix + "plant":
|
||||
var bomb = active_bomb.instantiate()
|
||||
Session.dynamic_objects_container.add_child(bomb,true)
|
||||
bomb.global_position = machine.player_camera.get_parent().global_position
|
||||
|
||||
Session.spawn({"scene": active_bomb, "position": machine.player_camera.get_parent().global_position})
|
||||
|
||||
machine.ammo -= 1
|
||||
return_to_previous.emit()
|
||||
|
||||
func state_input(event: InputEvent) -> void:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue