Add collision detection
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://ds2y8l8onrs4f"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://ds2y8l8onrs4f"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Blizzard.cs" id="1_rqtsv"]
|
||||
|
||||
@@ -9,19 +9,24 @@ albedo_color = Color(0.137255, 0.447059, 0.796078, 1)
|
||||
radial_segments = 4
|
||||
rings = 1
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_xe0sc"]
|
||||
|
||||
[node name="Blizzard" type="Node3D"]
|
||||
script = ExtResource("1_rqtsv")
|
||||
Cooldown = 1.0
|
||||
_projectileSpeed = 10.0
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 16
|
||||
mass = 0.01
|
||||
gravity_scale = 0.0
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.11373, 0)
|
||||
material_override = SubResource("StandardMaterial3D_pd0mo")
|
||||
mesh = SubResource("SphereMesh_g0pbs")
|
||||
skeleton = NodePath("../..")
|
||||
|
||||
[node name="TimeToLive" type="Timer" parent="."]
|
||||
wait_time = 2.5
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[connection signal="timeout" from="TimeToLive" to="." method="OnTimeToLiveTimeout"]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.11958, 0)
|
||||
shape = SubResource("SphereShape3D_xe0sc")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=18 format=3 uid="uid://bcsgd8vxy43g2"]
|
||||
[gd_scene load_steps=19 format=3 uid="uid://bcsgd8vxy43g2"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Player.cs" id="1_8dc05"]
|
||||
[ext_resource type="PackedScene" uid="uid://d20uxkpid4ynd" path="res://Models/vivi1.gltf" id="1_mqt2m"]
|
||||
@@ -9,6 +9,7 @@
|
||||
[ext_resource type="Script" path="res://Scripts/NPCFollow.cs" id="4_o5mpp"]
|
||||
[ext_resource type="Script" path="res://Scripts/DebugText.cs" id="8_ksx3s"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://35saq7eyk446" path="res://Models/Cookie.obj" id="8_p45nj"]
|
||||
[ext_resource type="Script" path="res://Scripts/Enemy.cs" id="9_0gfg2"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_8verc"]
|
||||
size = Vector3(100, 2, 100)
|
||||
@@ -116,22 +117,27 @@ material_override = SubResource("StandardMaterial3D_ultw4")
|
||||
use_collision = true
|
||||
size = Vector3(15.0266, 4.74018, 1)
|
||||
|
||||
[node name="CharacterBody3D" type="CharacterBody3D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 16
|
||||
|
||||
[node name="Cookie" type="MeshInstance3D" parent="CharacterBody3D"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, -8.04457, -0.130408, -1.66095)
|
||||
mesh = ExtResource("8_p45nj")
|
||||
skeleton = NodePath("../..")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="CharacterBody3D"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, -8.04457, 0.690081, -1.66095)
|
||||
shape = SubResource("CapsuleShape3D_y33ih")
|
||||
|
||||
[node name="DebugUI" type="Node2D" parent="."]
|
||||
|
||||
[node name="TextEdit" type="TextEdit" parent="DebugUI"]
|
||||
offset_right = 3468.0
|
||||
offset_bottom = 777.0
|
||||
script = ExtResource("8_ksx3s")
|
||||
|
||||
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 17
|
||||
max_contacts_reported = 10
|
||||
contact_monitor = true
|
||||
script = ExtResource("9_0gfg2")
|
||||
|
||||
[node name="Cookie" type="MeshInstance3D" parent="RigidBody3D"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, -8.04457, -0.130408, -1.66095)
|
||||
mesh = ExtResource("8_p45nj")
|
||||
skeleton = NodePath("../..")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, -8.04457, 0.690081, -1.66095)
|
||||
shape = SubResource("CapsuleShape3D_y33ih")
|
||||
|
||||
[connection signal="body_entered" from="RigidBody3D" to="RigidBody3D" method="OnHit"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dg7731nx22ewp"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dg7731nx22ewp"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Fireball.cs" id="1_4ipg4"]
|
||||
|
||||
@@ -7,19 +7,26 @@ albedo_color = Color(0.666667, 0, 0.239216, 1)
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_6bhr7"]
|
||||
|
||||
[node name="Fireball" type="Node3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.916843, 0)
|
||||
script = ExtResource("1_4ipg4")
|
||||
Cooldown = 0.3
|
||||
_projectileSpeed = 20.0
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_64t08"]
|
||||
radius = 0.51754
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.00392, 0)
|
||||
[node name="RigidBody3D" type="RigidBody3D"]
|
||||
collision_layer = 16
|
||||
gravity_scale = 0.0
|
||||
max_contacts_reported = 5
|
||||
contact_monitor = true
|
||||
script = ExtResource("1_4ipg4")
|
||||
_projectileSpeed = 10.0
|
||||
|
||||
[node name="Fireball" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.916843, 0)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Fireball"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0870771, 0)
|
||||
material_override = SubResource("StandardMaterial3D_jxwqo")
|
||||
mesh = SubResource("SphereMesh_6bhr7")
|
||||
skeleton = NodePath("../../..")
|
||||
|
||||
[node name="TimeToLive" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[connection signal="timeout" from="TimeToLive" to="." method="OnTimeToLiveTimeout"]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.00448, 0.081282)
|
||||
shape = SubResource("SphereShape3D_64t08")
|
||||
|
||||
Reference in New Issue
Block a user