From 8ff2487734df59855bbfd988d88b3b32273049e2 Mon Sep 17 00:00:00 2001 From: Lucas Fryzek Date: Mon, 23 Sep 2024 20:33:36 +0100 Subject: player: Make bullet shoot directly up properly --- scripts/player.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/player.gd b/scripts/player.gd index e76b4d1..f476bf0 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -65,7 +65,10 @@ func fire_weapon() -> void: bullet.position = starting_pos bullet.target = end get_tree().get_root().add_child(bullet) - bullet.look_at(end) + var up = Vector3.UP + if abs(global_transform.basis.z.y) > 0.99: + up = Vector3(0, 0, 1) + bullet.look_at(end, up) func _physics_process(_delta: float) -> void: do_grapple() -- cgit