generated from krampus/template-godot4
Added dummy enemy
This commit is contained in:
parent
d2a3058fd6
commit
84a6611ba3
|
@ -0,0 +1,12 @@
|
|||
extends CharacterBody3D
|
||||
|
||||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
velocity.y -= gravity * delta
|
||||
|
||||
move_and_slide()
|
|
@ -0,0 +1,38 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://2vetjvn3w0si"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/npc/dummy/dummy.gd" id="1_fw1h8"]
|
||||
[ext_resource type="Texture2D" uid="uid://b0yefajw1cqo" path="res://assets/textures/character_placeholder.png" id="1_jiqkj"]
|
||||
[ext_resource type="Shader" path="res://src/shaders/spatial_threshold.gdshader" id="2_lqgq8"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_g4reu"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("2_lqgq8")
|
||||
shader_parameter/color_low = Color(0, 0, 0, 1)
|
||||
shader_parameter/color_hi = Color(1, 1, 1, 1)
|
||||
shader_parameter/threshold = 0.19
|
||||
shader_parameter/contrast = 1.0
|
||||
shader_parameter/offset = 0.0
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1rns5"]
|
||||
next_pass = SubResource("ShaderMaterial_g4reu")
|
||||
albedo_texture = ExtResource("1_jiqkj")
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_b3qv8"]
|
||||
material = SubResource("StandardMaterial3D_1rns5")
|
||||
radius = 0.7
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_3x80o"]
|
||||
radius = 0.7
|
||||
|
||||
[node name="Dummy" type="CharacterBody3D"]
|
||||
script = ExtResource("1_fw1h8")
|
||||
|
||||
[node name="Mesh" type="Node3D" parent="."]
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Mesh"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_b3qv8")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("CapsuleShape3D_3x80o")
|
Loading…
Reference in New Issue