mortar + mini gun cannot hit weak points

This commit is contained in:
Michael Campbell 2026-02-19 01:01:39 -05:00
parent f73f093ae2
commit 045faf2333
10 changed files with 77 additions and 1 deletions

View file

@ -0,0 +1,17 @@
class_name MortarProjectile
extends Node3D
var velocity: Vector3
const GRAVITY := 40.
func _process(delta: float) -> void:
position += velocity * delta
velocity += GRAVITY * Vector3.DOWN * delta
if position.y <= 0.:
var explosion := preload("res://player/explosion/explosion.tscn").instantiate()
explosion.position = position
add_sibling(explosion)
queue_free()

View file

@ -0,0 +1 @@
uid://dgnyxjs1f61lc

View file

@ -0,0 +1,11 @@
[gd_scene format=3 uid="uid://i5lihai81ec1"]
[ext_resource type="Script" uid="uid://dgnyxjs1f61lc" path="res://player/projectile/mortar_projectile.gd" id="1_7aq8w"]
[sub_resource type="SphereMesh" id="SphereMesh_7aq8w"]
[node name="MortarProjectile" type="Node3D" unique_id=1380191443]
script = ExtResource("1_7aq8w")
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=380266621]
mesh = SubResource("SphereMesh_7aq8w")

View file

@ -10,6 +10,7 @@ var health: int = 1:
if v == 0:
queue_free()
var damage := 10.
var can_hit_weak_points := true
func _on_collision(node: Node3D):
if node.has_method("hit"):