Bullet hit rock detection
This commit is contained in:
@@ -19,8 +19,8 @@ Cooldown = 0.5
|
|||||||
_projectileSpeed = 15.0
|
_projectileSpeed = 15.0
|
||||||
|
|
||||||
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
||||||
collision_layer = 2
|
collision_layer = 18
|
||||||
collision_mask = 0
|
collision_mask = 16
|
||||||
gravity_scale = 0.0
|
gravity_scale = 0.0
|
||||||
custom_integrator = true
|
custom_integrator = true
|
||||||
continuous_cd = true
|
continuous_cd = true
|
||||||
@@ -41,3 +41,5 @@ shape = SubResource("SphereShape3D_rokeu")
|
|||||||
pixel_size = 0.05
|
pixel_size = 0.05
|
||||||
axis = 1
|
axis = 1
|
||||||
texture = ExtResource("2_n5c16")
|
texture = ExtResource("2_n5c16")
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="RigidBody3D" to="." method="OnBulletHitObject"]
|
||||||
|
|||||||
@@ -84,20 +84,24 @@ shape = SubResource("BoxShape3D_sjyl3")
|
|||||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -48.9058, -1.95573, -40.25)
|
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -48.9058, -1.95573, -40.25)
|
||||||
shape = SubResource("BoxShape3D_sjyl3")
|
shape = SubResource("BoxShape3D_sjyl3")
|
||||||
|
|
||||||
[node name="Rock1" type="CollisionShape3D" parent="StaticBody3D"]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.93645, 5.82082, -21.6909)
|
|
||||||
shape = SubResource("CylinderShape3D_lhgew")
|
|
||||||
|
|
||||||
[node name="Rock2" type="CollisionShape3D" parent="StaticBody3D"]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.82773, 6.46042, -40.6232)
|
|
||||||
shape = SubResource("CylinderShape3D_fa41j")
|
|
||||||
|
|
||||||
[node name="Rock3" type="CollisionShape3D" parent="StaticBody3D"]
|
|
||||||
transform = Transform3D(0.999841, -0.0178538, 0, 0.0178538, 0.999841, 0, 0, 0, 1, -6.84036, 6.33278, -46.1737)
|
|
||||||
shape = SubResource("CylinderShape3D_krlem")
|
|
||||||
|
|
||||||
[node name="TestEnemy" parent="." instance=ExtResource("3_ds7vi")]
|
[node name="TestEnemy" parent="." instance=ExtResource("3_ds7vi")]
|
||||||
transform = Transform3D(0.998405, 0.0226647, 0.0517184, -0.0544217, 0.630486, 0.77429, -0.0150588, -0.775869, 0.630714, -20.5579, 5.52246, -43.2246)
|
transform = Transform3D(0.998405, 0.0226647, 0.0517184, -0.0544217, 0.630486, 0.77429, -0.0150588, -0.775869, 0.630714, -20.5579, 5.52246, -43.2246)
|
||||||
|
|
||||||
[node name="SpawnPoint" type="Marker3D" parent="."]
|
[node name="SpawnPoint" type="Marker3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, -0.757998, 6.71652, -10.4768)
|
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, -0.757998, 6.71652, -10.4768)
|
||||||
|
|
||||||
|
[node name="StaticBody3D2" type="StaticBody3D" parent="."]
|
||||||
|
collision_layer = 16
|
||||||
|
collision_mask = 16
|
||||||
|
|
||||||
|
[node name="Rock1" type="CollisionShape3D" parent="StaticBody3D2"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.93645, 5.82082, -21.6909)
|
||||||
|
shape = SubResource("CylinderShape3D_lhgew")
|
||||||
|
|
||||||
|
[node name="Rock2" type="CollisionShape3D" parent="StaticBody3D2"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.82773, 6.46042, -40.6232)
|
||||||
|
shape = SubResource("CylinderShape3D_fa41j")
|
||||||
|
|
||||||
|
[node name="Rock3" type="CollisionShape3D" parent="StaticBody3D2"]
|
||||||
|
transform = Transform3D(0.999841, -0.0178538, 0, 0.0178538, 0.999841, 0, 0, 0, 1, -6.84036, 6.33278, -46.1737)
|
||||||
|
shape = SubResource("CylinderShape3D_krlem")
|
||||||
|
|||||||
@@ -6,4 +6,9 @@ public partial class TestBullet : Projectile
|
|||||||
{
|
{
|
||||||
Translate(new Vector3(0, 0, Speed * -(float)delta));
|
Translate(new Vector3(0, 0, Speed * -(float)delta));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnBulletHitObject(Node node)
|
||||||
|
{
|
||||||
|
QueueFree();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ config_version=5
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="GameJam2023"
|
config/name="GameJam2023"
|
||||||
run/main_scene="res://Scenes/Main.tscn"
|
run/main_scene="res://Scenes/TestLevel.tscn"
|
||||||
config/features=PackedStringArray("4.1", "C#", "Forward Plus")
|
config/features=PackedStringArray("4.1", "C#", "Forward Plus")
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|||||||
Reference in New Issue
Block a user