Link CAN hit

This commit is contained in:
2023-09-02 01:41:34 -07:00
parent 955f9d307c
commit de037da23b
7 changed files with 123 additions and 27 deletions

30
Scenes/TestBullet.tscn Normal file
View File

@@ -0,0 +1,30 @@
[gd_scene load_steps=5 format=3 uid="uid://si4byubqnng4"]
[ext_resource type="Script" path="res://Scripts/TestBullet.cs" id="1_cavby"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5vpcx"]
albedo_color = Color(0.584314, 0.0352941, 0.141176, 1)
[sub_resource type="SphereMesh" id="SphereMesh_wuk0e"]
material = SubResource("StandardMaterial3D_5vpcx")
[sub_resource type="SphereShape3D" id="SphereShape3D_rokeu"]
[node name="TestBullet" type="Node3D"]
script = ExtResource("1_cavby")
_projectileSpeed = 5.0
[node name="RigidBody3D" type="RigidBody3D" parent="."]
collision_layer = 0
gravity_scale = 0.0
continuous_cd = true
contact_monitor = true
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D"]
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0, 0)
mesh = SubResource("SphereMesh_wuk0e")
skeleton = NodePath("../..")
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0, 0)
shape = SubResource("SphereShape3D_rokeu")

View File

@@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://b38hcomu4tpm5"]
[gd_scene load_steps=5 format=3 uid="uid://b38hcomu4tpm5"]
[ext_resource type="Script" path="res://Scripts/TestCharacter.cs" id="1_hddqi"]
[ext_resource type="PackedScene" uid="uid://dtyujwnb6w3kv" path="res://Models/TestModels/link.gltf" id="1_rwdbt"]
[ext_resource type="PackedScene" uid="uid://si4byubqnng4" path="res://Scenes/TestBullet.tscn" id="3_ojvu2"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_fqik1"]
radius = 0.152487
@@ -10,6 +11,7 @@ height = 0.456443
[node name="Character" type="CharacterBody3D"]
script = ExtResource("1_hddqi")
_speed = 2.0
_attackPattern = ExtResource("3_ojvu2")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 0.19703, 0)
@@ -18,4 +20,4 @@ shape = SubResource("CapsuleShape3D_fqik1")
[node name="Pivot" type="Node3D" parent="."]
[node name="link" parent="Pivot" instance=ExtResource("1_rwdbt")]
transform = Transform3D(-10, 0, 8.74228e-07, 0, 10, 0, -8.74228e-07, 0, -10, 0, 0, 0)
transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0)

View File

@@ -19,9 +19,13 @@ shape = SubResource("BoxShape3D_dk0pn")
mesh = SubResource("BoxMesh_eaper")
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -0.118128, 5.82113, -1.13346)
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -0.118128, 8.18686, -1.13346)
fov = 40.0
[node name="DebugCamera" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.821149, 0.570714, 0, -0.570714, 0.821149, -0.36148, 1.40359, 0.864433)
visible = false
[node name="Link" parent="." instance=ExtResource("1_fwf6c")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)