Initial Commit
This commit is contained in:
commit
d13e420c1a
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Normalize EOL for all files that Git considers text files.
|
||||||
|
* text=auto eol=lf
|
||||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Godot 4+ specific ignores
|
||||||
|
.godot/
|
||||||
|
/android/
|
||||||
18
Character.tscn
Normal file
18
Character.tscn
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://cu1bnkqxd1nyh"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://character.gd" id="1_32tgv"]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_4w3u7"]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleMesh" id="CapsuleMesh_2wqp7"]
|
||||||
|
|
||||||
|
[node name="Character" type="CharacterBody3D"]
|
||||||
|
script = ExtResource("1_32tgv")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||||
|
shape = SubResource("CapsuleShape3D_4w3u7")
|
||||||
|
|
||||||
|
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||||
|
mesh = SubResource("CapsuleMesh_2wqp7")
|
||||||
35
character.gd
Normal file
35
character.gd
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
extends CharacterBody3D
|
||||||
|
|
||||||
|
var movement_speed: float = 2.0
|
||||||
|
var movement_target_position: Vector3 = Vector3(-3.0,0.0,3.5)
|
||||||
|
|
||||||
|
@onready var navigation_agent: NavigationAgent3D = $NavigationAgent3D
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
# These values need to be adjusted for the actor's speed
|
||||||
|
# and the navigation layout.
|
||||||
|
navigation_agent.path_desired_distance = 0.5
|
||||||
|
navigation_agent.target_desired_distance = 0.75
|
||||||
|
|
||||||
|
# Make sure to not await during _ready.
|
||||||
|
actor_setup.call_deferred()
|
||||||
|
|
||||||
|
func actor_setup():
|
||||||
|
# Wait for the first physics frame so the NavigationServer can sync.
|
||||||
|
await get_tree().physics_frame
|
||||||
|
|
||||||
|
# Now that the navigation map is no longer empty, set the movement target.
|
||||||
|
set_movement_target(movement_target_position)
|
||||||
|
|
||||||
|
func set_movement_target(movement_target: Vector3):
|
||||||
|
navigation_agent.set_target_position(movement_target)
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
if navigation_agent.is_navigation_finished():
|
||||||
|
return
|
||||||
|
|
||||||
|
var current_agent_position: Vector3 = global_position
|
||||||
|
var next_path_position: Vector3 = navigation_agent.get_next_path_position()
|
||||||
|
|
||||||
|
velocity = current_agent_position.direction_to(next_path_position) * movement_speed
|
||||||
|
move_and_slide()
|
||||||
1
icon.svg
Normal file
1
icon.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
||||||
|
After Width: | Height: | Size: 994 B |
37
icon.svg.import
Normal file
37
icon.svg.import
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://c461u1k5nnc3e"
|
||||||
|
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.svg"
|
||||||
|
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
|
svg/scale=1.0
|
||||||
|
editor/scale_with_editor_scale=false
|
||||||
|
editor/convert_colors_with_editor_theme=false
|
||||||
63
lake.tscn
Normal file
63
lake.tscn
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://b5i2qmhgqp617"]
|
||||||
|
|
||||||
|
[sub_resource type="NavigationMesh" id="NavigationMesh_nu02n"]
|
||||||
|
vertices = PackedVector3Array(-49.5, 2, -39.8369, -19.75, 2, -39.5869, -19.5, 2, -41.8369, -18.75, 2, -42.5869, -10.5, 2, -47.8369, -10.5, 2, -94.8369, -49.5, 2, -94.8369, -8.5, 2, -47.5869, -8.25, 2, -94.8369, -3.25, 2, -46.5869, -3, 2, -94.8369, 2, 2, -45.5869, 2.25, 2, -94.8369, 7.25, 2, -44.5869, 7.5, 2, -94.8369, 25.25, 2, -29.3369, 25.25, 2, -27.8369, 49.5, 2, -28.0869, 10.5, 2, -44.0869, 49.5, 2, -94.8369, -20.5, 2, -28.3369, -49.5, 2, -28.3369, -21.5, 2, -15.5869, -49.5, 2, -15.5869, 26.25, 2, -21.0869, 49.5, 2, -21.3369, 27.25, 2, -13.3369, 49.5, 2, -13.5869, -21.5, 2, -14.0869, -13.5, 2, -1.08691, -12.25, 2, -0.0869141, -49.5, 2, 49.4131, -4, 2, 49.4131, -3.75, 2, 2.66309, -6, 2, 2.41309, 27.75, 2, -9.83691, 27.5, 2, -7.83691, 49.5, 2, -7.83691, 23, 2, 1.41309, 20.5, 2, 2.66309, 19.25, 2, 49.4131, 49.5, 2, 49.4131, 19, 2, 2.66309)
|
||||||
|
polygons = [PackedInt32Array(2, 1, 0), PackedInt32Array(3, 2, 0), PackedInt32Array(3, 0, 4), PackedInt32Array(4, 0, 5), PackedInt32Array(5, 0, 6), PackedInt32Array(5, 8, 4), PackedInt32Array(4, 8, 7), PackedInt32Array(8, 10, 7), PackedInt32Array(7, 10, 9), PackedInt32Array(10, 12, 9), PackedInt32Array(9, 12, 11), PackedInt32Array(12, 14, 11), PackedInt32Array(11, 14, 13), PackedInt32Array(17, 16, 15), PackedInt32Array(15, 18, 17), PackedInt32Array(17, 18, 14), PackedInt32Array(17, 14, 19), PackedInt32Array(13, 14, 18), PackedInt32Array(21, 0, 20), PackedInt32Array(20, 0, 1), PackedInt32Array(23, 21, 22), PackedInt32Array(22, 21, 20), PackedInt32Array(25, 24, 17), PackedInt32Array(17, 24, 16), PackedInt32Array(27, 26, 25), PackedInt32Array(25, 26, 24), PackedInt32Array(23, 22, 28), PackedInt32Array(23, 28, 29), PackedInt32Array(29, 30, 23), PackedInt32Array(23, 30, 31), PackedInt32Array(31, 30, 32), PackedInt32Array(32, 34, 33), PackedInt32Array(32, 30, 34), PackedInt32Array(37, 36, 35), PackedInt32Array(26, 27, 35), PackedInt32Array(35, 27, 37), PackedInt32Array(38, 36, 37), PackedInt32Array(38, 37, 39), PackedInt32Array(39, 37, 40), PackedInt32Array(40, 37, 41), PackedInt32Array(40, 42, 39), PackedInt32Array(33, 42, 32), PackedInt32Array(32, 42, 40)]
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mmd0r"]
|
||||||
|
albedo_color = Color(0.0853566, 0.29, 0.0783, 1)
|
||||||
|
|
||||||
|
[node name="Lake" type="Node3D"]
|
||||||
|
|
||||||
|
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
|
||||||
|
navigation_mesh = SubResource("NavigationMesh_nu02n")
|
||||||
|
|
||||||
|
[node name="Level" type="CSGCombiner3D" parent="NavigationRegion3D"]
|
||||||
|
|
||||||
|
[node name="CSGBox3D" type="CSGBox3D" parent="NavigationRegion3D/Level"]
|
||||||
|
transform = Transform3D(100, 0, 0, 0, 3, 0, 0, 0, 100, 0, 0, -22.6685)
|
||||||
|
size = Vector3(1, 1, 1.45337)
|
||||||
|
material = SubResource("StandardMaterial3D_mmd0r")
|
||||||
|
|
||||||
|
[node name="LakeArea" type="CSGCombiner3D" parent="NavigationRegion3D/Level"]
|
||||||
|
operation = 2
|
||||||
|
|
||||||
|
[node name="CSGBox3D" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"]
|
||||||
|
transform = Transform3D(8.96721, 0, 0, 0, 5.63, 0, 0, 0, 4.82575, 7.63805, 0, -4.49351)
|
||||||
|
size = Vector3(2.70355, 1, 2.8623)
|
||||||
|
|
||||||
|
[node name="CSGBox3D2" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"]
|
||||||
|
transform = Transform3D(8.3338, 0, -1.78149, 0, 5.63, 0, 3.31036, 0, 4.48488, -6.32943, 0, -5.02246)
|
||||||
|
size = Vector3(1, 1, 2.5874)
|
||||||
|
|
||||||
|
[node name="CSGBox3D3" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"]
|
||||||
|
transform = Transform3D(4.69402, 0, -4.11177, 0, 5.63, 0, 7.64048, 0, 2.52611, -10.3268, 9.53674e-07, -11.8459)
|
||||||
|
size = Vector3(1.78711, 1, 3.23682)
|
||||||
|
|
||||||
|
[node name="CSGBox3D4" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"]
|
||||||
|
transform = Transform3D(-0.68499, 0, -4.81165, 0, 5.63, 0, 8.941, 0, -0.368631, -10.2995, 9.53674e-07, -27.4584)
|
||||||
|
size = Vector3(3.03076, 1, 4.09277)
|
||||||
|
|
||||||
|
[node name="CSGBox3D5" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"]
|
||||||
|
transform = Transform3D(-7.48565, 0, -2.65698, 0, 5.63, 0, 4.93719, 0, -4.02844, -10.8011, 9.53674e-07, -38.7966)
|
||||||
|
size = Vector3(1.18384, 1, 2.89941)
|
||||||
|
|
||||||
|
[node name="CSGBox3D6" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"]
|
||||||
|
transform = Transform3D(-8.80802, 0, 0.905248, 0, 5.63, 0, -1.68213, 0, -4.74008, -1.97462, 9.53674e-07, -34.7349)
|
||||||
|
size = Vector3(2.31555, 1, 4.58154)
|
||||||
|
|
||||||
|
[node name="CSGBox3D7" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"]
|
||||||
|
transform = Transform3D(-6.36342, 0, 3.40009, 0, 5.63, 0, -6.31804, 0, -3.42451, 5.90479, 9.53674e-07, -24.6551)
|
||||||
|
size = Vector3(2.31555, 1, 6.84082)
|
||||||
|
|
||||||
|
[node name="CSGBox3D8" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"]
|
||||||
|
transform = Transform3D(-1.14438, 0, 4.78629, 0, 5.63, 0, -8.89388, 0, -0.615856, 17.7987, 9.53674e-07, -17.7252)
|
||||||
|
size = Vector3(2.31555, 1, 3.4624)
|
||||||
|
|
||||||
|
[node name="CSGBox3D9" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"]
|
||||||
|
transform = Transform3D(3.87164, 0, 4.35278, 0, 5.63, 0, -8.08834, 0, 2.08354, 13.9638, 9.53674e-07, -8.95581)
|
||||||
|
size = Vector3(1.23151, 1, 5.03125)
|
||||||
|
|
||||||
|
[node name="CSGBox3D10" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"]
|
||||||
|
transform = Transform3D(8.28348, 0, 1.84821, 0, 5.63, 0, -3.43435, 0, 4.4578, 20.2467, 9.53674e-07, -0.416638)
|
||||||
|
size = Vector3(0.334114, 1, 1)
|
||||||
20
project.godot
Normal file
20
project.godot
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
; Engine configuration file.
|
||||||
|
; It's best edited using the editor UI and not directly,
|
||||||
|
; since the parameters that go here are not all obvious.
|
||||||
|
;
|
||||||
|
; Format:
|
||||||
|
; [section] ; section goes between []
|
||||||
|
; param=value ; assign values to parameters
|
||||||
|
|
||||||
|
config_version=5
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="Helios Discord App"
|
||||||
|
config/features=PackedStringArray("4.3", "GL Compatibility")
|
||||||
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
renderer/rendering_method="gl_compatibility"
|
||||||
|
renderer/rendering_method.mobile="gl_compatibility"
|
||||||
Loading…
x
Reference in New Issue
Block a user