collider tests
This commit is contained in:
@@ -187,4 +187,4 @@ Anim={
|
||||
"zfar": 4000.01,
|
||||
"znear": 0.05
|
||||
}
|
||||
selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21413/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@62/@VBoxContainer@63/@EditorMainScreen@103/MainScreen/@CanvasItemEditor@10871/@VSplitContainer@10516/@HSplitContainer@10518/@HSplitContainer@10520/@Control@10521/@SubViewportContainer@10522/@SubViewport@10523/World")])
|
||||
selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@20438/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@62/@VBoxContainer@63/@EditorMainScreen@103/MainScreen/@CanvasItemEditor@10871/@VSplitContainer@10516/@HSplitContainer@10518/@HSplitContainer@10520/@Control@10521/@SubViewportContainer@10522/@SubViewport@10523/World/Player")])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[folding]
|
||||
|
||||
node_unfolds=[]
|
||||
node_unfolds=[NodePath("Player"), PackedStringArray("Collision")]
|
||||
resource_unfolds=["res://DevTest.tscn::Environment_l2ce6", PackedStringArray("Background", "Ambient Light", "Tonemap", "Sky", "sky", "SSR")]
|
||||
nodes_folded=[]
|
||||
|
||||
@@ -187,4 +187,4 @@ Anim={
|
||||
"zfar": 4000.01,
|
||||
"znear": 0.05
|
||||
}
|
||||
selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@20438/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@62/@VBoxContainer@63/@EditorMainScreen@103/MainScreen/@CanvasItemEditor@10871/@VSplitContainer@10516/@HSplitContainer@10518/@HSplitContainer@10520/@Control@10521/@SubViewportContainer@10522/@SubViewport@10523/Node3D/Box3")])
|
||||
selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@20438/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@62/@VBoxContainer@63/@EditorMainScreen@103/MainScreen/@CanvasItemEditor@10871/@VSplitContainer@10516/@HSplitContainer@10518/@HSplitContainer@10520/@Control@10521/@SubViewportContainer@10522/@SubViewport@10523/Node3D")])
|
||||
|
||||
@@ -100,11 +100,11 @@ Anim={
|
||||
"translate_snap": 1.0,
|
||||
"viewport_mode": 1,
|
||||
"viewports": [{
|
||||
"auto_orthogonal": false,
|
||||
"auto_orthogonal": true,
|
||||
"auto_orthogonal_enabled": true,
|
||||
"cinematic_preview": false,
|
||||
"display_mode": 22,
|
||||
"distance": 4.0,
|
||||
"distance": 3.4293556,
|
||||
"doppler": false,
|
||||
"frame_time": false,
|
||||
"gizmos": true,
|
||||
@@ -113,13 +113,13 @@ Anim={
|
||||
"information": false,
|
||||
"listener": true,
|
||||
"lock_rotation": false,
|
||||
"orthogonal": false,
|
||||
"position": Vector3(-1.0236843, -0.07188046, 0.7774841),
|
||||
"orthogonal": true,
|
||||
"position": Vector3(0.25380337, 0.7973664, 1.5201828),
|
||||
"transform_gizmo": true,
|
||||
"use_environment": false,
|
||||
"view_type": 0,
|
||||
"x_rotation": 0.3167404,
|
||||
"y_rotation": -2.0489795
|
||||
"view_type": 6,
|
||||
"x_rotation": 0.0,
|
||||
"y_rotation": 3.1415927
|
||||
}, {
|
||||
"auto_orthogonal": false,
|
||||
"auto_orthogonal_enabled": true,
|
||||
@@ -187,4 +187,4 @@ Anim={
|
||||
"zfar": 4000.01,
|
||||
"znear": 0.05
|
||||
}
|
||||
selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@20438/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@62/@VBoxContainer@63/@EditorMainScreen@103/MainScreen/@CanvasItemEditor@10871/@VSplitContainer@10516/@HSplitContainer@10518/@HSplitContainer@10520/@Control@10521/@SubViewportContainer@10522/@SubViewport@10523/Player/CameraPivot/Camera3D")])
|
||||
selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@20438/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@62/@VBoxContainer@63/@EditorMainScreen@103/MainScreen/@CanvasItemEditor@10871/@VSplitContainer@10516/@HSplitContainer@10518/@HSplitContainer@10520/@Control@10521/@SubViewportContainer@10522/@SubViewport@10523/Player/OnAir")])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[folding]
|
||||
|
||||
node_unfolds=[NodePath("CameraPivot/Camera3D"), PackedStringArray("Transform")]
|
||||
resource_unfolds=["res://Player.tscn::CapsuleMesh_kpjcp", PackedStringArray(), "res://Player.tscn::CapsuleShape3D_kne1u", PackedStringArray()]
|
||||
nodes_folded=[]
|
||||
node_unfolds=[NodePath("CameraPivot/Camera3D"), PackedStringArray("Transform"), NodePath("OnAir"), PackedStringArray("shape")]
|
||||
resource_unfolds=["res://Player.tscn::CapsuleMesh_kpjcp", PackedStringArray(), "res://Player.tscn::CapsuleShape3D_kne1u", PackedStringArray(), "res://Player.tscn::CapsuleShape3D_xhfnw", PackedStringArray()]
|
||||
nodes_folded=[NodePath("CameraPivot")]
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
Panel
|
||||
CanvasLayer
|
||||
CollisionShape3D
|
||||
CSGMesh3D
|
||||
StaticBody3D
|
||||
|
||||
@@ -9,7 +9,7 @@ dock_filesystem_v_split_offset=0
|
||||
dock_filesystem_display_mode=0
|
||||
dock_filesystem_file_sort=0
|
||||
dock_filesystem_file_list_display_mode=1
|
||||
dock_filesystem_selected_paths=PackedStringArray("res://assets/Materials/wood_planks/textures/wood_planks_rough_1k.png")
|
||||
dock_filesystem_selected_paths=PackedStringArray("res://DevTest.tscn")
|
||||
dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://assets/", "res://assets/Materials/", "res://assets/Materials/wood_planks/", "res://assets/Materials/wood_planks/textures/", "res://assets/Materials/stone_pathway/textures/")
|
||||
dock_node_current_tab=0
|
||||
dock_history_include_scene=true
|
||||
@@ -28,11 +28,11 @@ dock_5="Inspector,Node,History"
|
||||
|
||||
[EditorNode]
|
||||
|
||||
open_scenes=PackedStringArray("res://Floor.tscn", "res://Player.tscn")
|
||||
current_scene="res://Floor.tscn"
|
||||
open_scenes=PackedStringArray("res://DevTest.tscn", "res://Player.tscn")
|
||||
current_scene="res://Player.tscn"
|
||||
center_split_offset=0
|
||||
selected_default_debugger_tab_idx=0
|
||||
selected_main_editor_idx=1
|
||||
selected_main_editor_idx=2
|
||||
selected_bottom_panel_item=0
|
||||
|
||||
[EditorWindow]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
63f7b34db8d8cdea90c76aacccf841ec
|
||||
::res://::1767481049
|
||||
::res://::1767487807
|
||||
DevTest.tscn::PackedScene::9123247578013174228::1767411651::0::1::::<><><>0<>0<><>::uid://grcsjnqdsbmj::::res://Floor.tscn<>uid://dsj41jw17qh40::::res://Player.tscn
|
||||
Floor.tscn::PackedScene::456381555447325093::1767479615::0::1::::<><><>0<>0<><>::uid://dwdp3f073q201::::res://assets/Materials/stone_pathway/textures/stone_pathway_02_diff_1k.png<>uid://dth2ctcqe0nri::::res://assets/Materials/stone_pathway/textures/stone_pathway_02_nor_gl_1k.png<>uid://c8vnh4apwdyy6::::res://assets/Materials/stone_pathway/textures/stone_pathway_02_rough_1k.png
|
||||
Player.tscn::PackedScene::8443048367702749007::1767480833::0::1::::<><><>0<>0<><>::uid://b8ddkhlwoiuvm::::res://Scripts/player.gd
|
||||
Floor.tscn::PackedScene::456381555447325093::1767482397::0::1::::<><><>0<>0<><>::uid://dwdp3f073q201::::res://assets/Materials/stone_pathway/textures/stone_pathway_02_diff_1k.png<>uid://dth2ctcqe0nri::::res://assets/Materials/stone_pathway/textures/stone_pathway_02_nor_gl_1k.png<>uid://c8vnh4apwdyy6::::res://assets/Materials/stone_pathway/textures/stone_pathway_02_rough_1k.png<>uid://c6c1fcbsll0mm::::res://assets/Materials/wood_planks/textures/wood_planks_diff_1k.png<>uid://dwxtktkem6kgb::::res://assets/Materials/wood_planks/textures/wood_planks_nor_gl_1k.png<>uid://54xt1ehp2lqm::::res://assets/Materials/wood_planks/textures/wood_planks_rough_1k.png
|
||||
Player.tscn::PackedScene::8443048367702749007::1767481734::0::1::::<><><>0<>0<><>::uid://b8ddkhlwoiuvm::::res://Scripts/player.gd
|
||||
::res://assets/::1767416168
|
||||
icon.svg::CompressedTexture2D::347234531240620840::1767410708::1767410719::1::::<><><>0<>0<>cd8caee1c8a7b4b3cbd67faa4c96c3c0<>res://.godot/imported/icon.svg-56083ea2a1f1a4f1e49773bdc6d7826c.ctex::
|
||||
::res://assets/Materials/::1767481029
|
||||
@@ -13,10 +13,10 @@ stone_pathway_02_disp_1k.png::CompressedTexture2D::6812096667217185925::17674163
|
||||
stone_pathway_02_nor_gl_1k.png::CompressedTexture2D::8508944656639413126::1767416372::1767416516::1::::<><><>0<>0<>82cd783198cdc6e8bee4a3c3fa744c24<>res://.godot/imported/stone_pathway_02_nor_gl_1k.png-90a48320dd4c9c60b9e68fa350107138.s3tc.ctex::
|
||||
stone_pathway_02_rough_1k.png::CompressedTexture2D::7133228485628055815::1767416372::1767416631::1::::<><><>0<>0<>ca9d6e30979c45204097877beba0ef3e<>res://.godot/imported/stone_pathway_02_rough_1k.png-7bc2e60cf9d95ba7753177c3883fca73.s3tc.ctex::
|
||||
::res://assets/Materials/wood_planks/::1767481021
|
||||
::res://assets/Materials/wood_planks/textures/::1767481021
|
||||
::res://assets/Materials/wood_planks/textures/::1767481487
|
||||
wood_planks_diff_1k.png::CompressedTexture2D::6954411953879281808::1767480996::1767481459::1::::<><><>0<>0<>aa75400313605363557468bc1955bd77<>res://.godot/imported/wood_planks_diff_1k.png-28832cc8b8be02a08eca68bbca5833d6.s3tc.ctex::
|
||||
wood_planks_disp_1k.png::CompressedTexture2D::189196940330241145::1767480998::1767481050::1::::<><><>0<>0<>322da655e040dd3a43fbb683f8f6268a<>res://.godot/imported/wood_planks_disp_1k.png-210b824a140b4c19e9a2cb4661fb0a7e.ctex::
|
||||
wood_planks_nor_gl_1k.png::CompressedTexture2D::8752069793851707053::1767481002::1767481442::1::::<><><>0<>0<>6f26dd0a61f6c720bb5117cbe149e0db<>res://.godot/imported/wood_planks_nor_gl_1k.png-d024cbb03b846bef5796ea2d214c03f5.s3tc.ctex::
|
||||
wood_planks_rough_1k.png::CompressedTexture2D::2166964057052015616::1767481004::1767481487::1::::<><><>0<>0<>0cffb3c51099170e58ad0c6876de9261<>res://.godot/imported/wood_planks_rough_1k.png-1147de2f8d0257affd8f6fc6e09389b5.s3tc.ctex::
|
||||
::res://Scripts/::1767480748
|
||||
player.gd::GDScript::4709046051602623302::1767480748::0::1::::<>CharacterBody3D<><>0<>0<><>::
|
||||
::res://Scripts/::1767482349
|
||||
player.gd::GDScript::4709046051602623302::1767482349::0::1::::<>CharacterBody3D<><>0<>0<><>::
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
res://Floor.tscn
|
||||
res://Player.tscn
|
||||
res://DevTest.tscn
|
||||
res://Scripts/player.gd
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[game_view]
|
||||
|
||||
select_mode=0
|
||||
embed_on_play=false
|
||||
select_mode=1
|
||||
embed_on_play=true
|
||||
|
||||
[editor_metadata]
|
||||
|
||||
@@ -15,7 +15,7 @@ search_help=Rect2(1920, 300, 960, 600)
|
||||
|
||||
[recent_files]
|
||||
|
||||
scenes=["res://Player.tscn", "res://node_3d.tscn", "res://Floor.tscn"]
|
||||
scenes=["res://Player.tscn", "res://DevTest.tscn", "res://node_3d.tscn", "res://Floor.tscn"]
|
||||
scripts=["res://Scripts/player.gd"]
|
||||
|
||||
[script_setup]
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 30,
|
||||
"column": 28,
|
||||
"folded_lines": Array[int]([]),
|
||||
"h_scroll_position": 0,
|
||||
"row": 10,
|
||||
"scroll_position": 0.0,
|
||||
"row": 95,
|
||||
"scroll_position": 78.0,
|
||||
"selection": false,
|
||||
"syntax_highlighter": "GDScript"
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -34,3 +34,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7.021526, 0)
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Panel" type="Panel" parent="CanvasLayer"]
|
||||
offset_right = 203.0
|
||||
offset_bottom = 113.0
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dsj41jw17qh40"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dsj41jw17qh40"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b8ddkhlwoiuvm" path="res://Scripts/player.gd" id="1_xhfnw"]
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_kpjcp"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_kne1u"]
|
||||
radius = 0.49804688
|
||||
height = 1.9969274
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_xhfnw"]
|
||||
radius = 0.49804688
|
||||
height = 1.0760319
|
||||
|
||||
[node name="Player" type="CharacterBody3D"]
|
||||
script = ExtResource("1_xhfnw")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
visible = false
|
||||
mesh = SubResource("CapsuleMesh_kpjcp")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
[node name="Standing" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0031564236, 0)
|
||||
shape = SubResource("CapsuleShape3D_kne1u")
|
||||
|
||||
[node name="CameraPivot" type="Node3D" parent="."]
|
||||
@@ -21,3 +29,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.54473054, 0)
|
||||
[node name="Camera3D" type="Camera3D" parent="CameraPivot"]
|
||||
current = true
|
||||
fov = 52.5
|
||||
|
||||
[node name="OnAir" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.46046007, 0)
|
||||
shape = SubResource("CapsuleShape3D_xhfnw")
|
||||
|
||||
@@ -8,9 +8,9 @@ extends CharacterBody3D
|
||||
@export var walk_speed := 10.0
|
||||
@export var crouch_speed := 5.0
|
||||
@export var slide_speed := 18.0
|
||||
@export var jump_velocity := 6.5
|
||||
@export var jump_velocity := 8.5
|
||||
|
||||
@export var ground_friction := 25.0
|
||||
@export var ground_friction := 35.0
|
||||
@export var slide_friction := 15.0
|
||||
|
||||
# ===== Air Control
|
||||
@@ -72,7 +72,7 @@ func _physics_process(delta):
|
||||
|
||||
# Gravity
|
||||
if not is_on_floor():
|
||||
velocity.y -= ProjectSettings.get_setting("physics/3d/default_gravity") * delta
|
||||
velocity.y -= ProjectSettings.get_setting("physics/3d/default_gravity") * 2 * delta
|
||||
|
||||
# Jump
|
||||
if Input.is_action_just_pressed("jump") and is_on_floor():
|
||||
@@ -86,14 +86,25 @@ func _physics_process(delta):
|
||||
var input_dir := get_input_direction()
|
||||
|
||||
if is_on_floor():
|
||||
#$Standing.disabled = false
|
||||
#$OnAir.disabled = true
|
||||
just_jumped = false
|
||||
preserve_air_momentum = false
|
||||
handle_ground(input_dir, delta)
|
||||
else:
|
||||
#$OnAir.disabled = false
|
||||
#$Standing.disabled = true
|
||||
apply_air_control(input_dir, delta)
|
||||
|
||||
move_and_slide()
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("ui_cancel"):
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
||||
if event is InputEventMouseButton:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
|
||||
func handle_ground(input_dir: Vector3, delta):
|
||||
if Input.is_action_just_pressed("crouch"):
|
||||
|
||||
Reference in New Issue
Block a user