Now About Social Code
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2024-09-23 20:33:36 +0100
committerLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2024-09-23 20:33:36 +0100
commit8ff2487734df59855bbfd988d88b3b32273049e2 (patch)
treead064a1552fcebf10588d21a329edb82f235a9c7
parent03080afab1ace191d0fda29845b033887e6e49f3 (diff)
player: Make bullet shoot directly up properly
-rw-r--r--scripts/player.gd5
1 files changed, 4 insertions, 1 deletions
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()