diff --git a/objects/Bullet/Bullet.gd b/objects/Bullet/Bullet.gd index bbe5515..2e262c1 100644 --- a/objects/Bullet/Bullet.gd +++ b/objects/Bullet/Bullet.gd @@ -3,7 +3,7 @@ extends Area3D signal exploded @export var muzzle_velocity = 100 # How fast the bullets are -@export var g = Vector3.DOWN * 20 +@export var g = Vector3.DOWN * 5 var velocity = Vector3.ZERO @@ -12,11 +12,11 @@ var godmode = 0 func _physics_process(delta): -# velocity += g * delta # Uncomment this for bullet gravity + velocity += g * delta # Bullet gravity look_at(transform.origin + velocity.normalized(), Vector3.UP) transform.origin += velocity * delta - for body in get_overlapping_bodies(): ### THIS IS OLD LOGIC, REPLACE. I'D RECOMMEND TO CHECK BY GROUP AND NOT BY NODE + for body in get_overlapping_bodies(): if body.is_in_group("human"): print("Bullet hit a human player") Global.playerHealth = Global.playerHealth - 10