rocket launcher moves objects, blast radius not falling off properly yet

This commit is contained in:
derek
2024-08-01 10:37:18 -05:00
parent 6354dc2774
commit dc6fcf9556
6 changed files with 80 additions and 31 deletions

View File

@@ -1,10 +1,17 @@
[gd_scene load_steps=9 format=3 uid="uid://hptaoyu5jeqk"]
[gd_scene load_steps=12 format=3 uid="uid://hptaoyu5jeqk"]
[ext_resource type="Texture2D" uid="uid://v6217lr32l0m" path="res://assets/Models/rocket1.png" id="1_f6yyc"]
[ext_resource type="Script" path="res://scripts/rocket.gd" id="1_s0phn"]
[ext_resource type="Texture2D" uid="uid://cfanvwkgixns0" path="res://assets/Models/rocket.rough.png" id="2_g6kha"]
[ext_resource type="PackedScene" uid="uid://6p7d7txcox7i" path="res://assets/rocket_explosion.tscn" id="2_mbh48"]
[sub_resource type="Curve" id="Curve_lnjp5"]
_data = [Vector2(0, 0), 0.0, 1.4, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_0mibw"]
curve = SubResource("Curve_lnjp5")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2051l"]
resource_name = "rocketlauncher1.rocket"
cull_mode = 2
@@ -54,7 +61,10 @@ shadow_mesh = SubResource("ArrayMesh_xh68t")
radius = 0.154605
height = 1.21279
[node name="Rocket" type="RigidBody3D"]
[sub_resource type="SphereShape3D" id="SphereShape3D_vdo7n"]
radius = 10.0
[node name="Rocket" type="RigidBody3D" node_paths=PackedStringArray("blast_radius")]
collision_layer = 6
collision_mask = 7
continuous_cd = true
@@ -62,14 +72,23 @@ max_contacts_reported = 100
contact_monitor = true
script = ExtResource("1_s0phn")
explosion = ExtResource("2_mbh48")
blast_radius = NodePath("BlastRadius")
blast_radius_falloff = SubResource("CurveTexture_0mibw")
[node name="Rocket" type="MeshInstance3D" parent="."]
transform = Transform3D(-1.48467e-14, -4.37114e-08, -1, -1, 3.13916e-07, 1.12501e-15, 3.13916e-07, 1, -4.37114e-08, -0.103685, 0, -0.116837)
transform = Transform3D(-1.48467e-14, -4.37114e-08, -1, -1, 3.13916e-07, 1.12501e-15, 3.13916e-07, 1, -4.37114e-08, 0, 0, -0.117)
mesh = SubResource("ArrayMesh_atqsb")
skeleton = NodePath("")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1.91069e-15, 4.37114e-08, -1, 1, -4.37114e-08, 0, -4.37114e-08, -1, -4.37114e-08, -0.131657, 0, 0.116837)
transform = Transform3D(1.91069e-15, 4.37114e-08, -1, 1, -4.37114e-08, 0, -4.37114e-08, -1, -4.37114e-08, 0, 0, 0.117)
shape = SubResource("CapsuleShape3D_8v4gm")
[node name="BlastRadius" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 7
[node name="radiusShape" type="CollisionShape3D" parent="BlastRadius"]
shape = SubResource("SphereShape3D_vdo7n")
[connection signal="body_shape_entered" from="." to="." method="_on_body_shape_entered"]

View File

@@ -218,6 +218,29 @@ _surfaces = [{
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_6x5ra")
[sub_resource type="Animation" id="Animation_0783b"]
resource_name = "empty"
[sub_resource type="Animation" id="Animation_maeha"]
resource_name = "inspect"
[sub_resource type="Animation" id="Animation_yxlbo"]
resource_name = "reload"
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(1),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"reload_finished"
}]
}
[sub_resource type="Animation" id="Animation_qw7o5"]
resource_name = "shoot"
length = 0.1
@@ -247,29 +270,6 @@ tracks/1/keys = {
"values": [Vector3(0, -1.5708, -1.5708), Vector3(0, -1.5708, -1.5708)]
}
[sub_resource type="Animation" id="Animation_yxlbo"]
resource_name = "reload"
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(1),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"reload_finished"
}]
}
[sub_resource type="Animation" id="Animation_0783b"]
resource_name = "empty"
[sub_resource type="Animation" id="Animation_maeha"]
resource_name = "inspect"
[sub_resource type="Animation" id="Animation_rqg2e"]
resource_name = "swap_in"
tracks/0/type = "value"
@@ -375,7 +375,7 @@ mesh = SubResource("ArrayMesh_5qx80")
skeleton = NodePath("")
[node name="BarrelRaycast" type="RayCast3D" parent="rocketlauncher1"]
transform = Transform3D(1.91069e-15, -1, -4.37114e-08, -4.37114e-08, -4.37114e-08, 1, -1, 3.53024e-22, -4.37114e-08, -0.0398292, -1.19895, -0.158627)
transform = Transform3D(1.91069e-15, -1, -4.37114e-08, -4.37114e-08, -4.37114e-08, 1, -1, 3.53024e-22, -4.37114e-08, 0, -1.199, 0)
target_position = Vector3(0, 0, -1)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]