oh my god let's try this again

This commit is contained in:
2025-08-12 04:38:42 -04:00
parent 6ae54ccfdb
commit c53ce71f7f
805 changed files with 141853 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
extends RigidBody3D
var grabbable : bool = true
@export var damage : float = 6.0
@export var min_damaging_velocity : float = 1.0
func _ready():
contact_monitor = true
max_contacts_reported = 2
set_collision_mask_value(2, true)
body_entered.connect(_on_body_entered)
func _on_body_entered(body):
if body.get("shootable") == true:
var totalvelocity = abs(angular_velocity.x + angular_velocity.y + angular_velocity.z)
if totalvelocity > (3 * min_damaging_velocity):
if body.get("rootnode") == true:
body.deal_damage(totalvelocity * damage)
else:
body.owner.deal_damage(totalvelocity * damage)
apply_central_impulse(body.position.direction_to(position) * -3.0)