Better sliding
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/Player")])
|
||||
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")])
|
||||
|
||||
@@ -31,15 +31,16 @@ dock_5="Inspector,Node,History"
|
||||
open_scenes=PackedStringArray("res://Floor.tscn", "res://Player.tscn", "res://DevTest.tscn")
|
||||
current_scene="res://Player.tscn"
|
||||
center_split_offset=0
|
||||
selected_default_debugger_tab_idx=0
|
||||
selected_default_debugger_tab_idx=1
|
||||
selected_main_editor_idx=2
|
||||
selected_bottom_panel_item=0
|
||||
|
||||
[EditorWindow]
|
||||
|
||||
screen=1
|
||||
mode="fullscreen"
|
||||
size=Vector2i(1908, 1163)
|
||||
position=Vector2i(1440, 0)
|
||||
mode="windowed"
|
||||
size=Vector2i(1920, 1200)
|
||||
position=Vector2i(1436, 28)
|
||||
|
||||
[ScriptEditor]
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[folding]
|
||||
|
||||
sections_unfolded=PackedStringArray()
|
||||
@@ -1,9 +1,9 @@
|
||||
63f7b34db8d8cdea90c76aacccf841ec
|
||||
::res://::1767411344
|
||||
::res://::1767414802
|
||||
DevTest.tscn::PackedScene::9123247578013174228::1767411651::0::1::::<><><>0<>0<><>::uid://grcsjnqdsbmj::::res://Floor.tscn<>uid://dsj41jw17qh40::::res://Player.tscn
|
||||
Floor.tscn::PackedScene::456381555447325093::1767411339::0::1::::<><><>0<>0<><>::
|
||||
Player.tscn::PackedScene::8443048367702749007::1767411222::0::1::::<><><>0<>0<><>::uid://b8ddkhlwoiuvm::::res://Scripts/player.gd
|
||||
node_3d.tscn::PackedScene::9123247578013174228::1767411436::0::1::::<><><>0<>0<><>::uid://grcsjnqdsbmj::::res://Floor.tscn<>uid://dsj41jw17qh40::::res://Player.tscn
|
||||
Player.tscn::PackedScene::8443048367702749007::1767414773::0::1::::<><><>0<>0<><>::uid://b8ddkhlwoiuvm::::res://Scripts/player.gd
|
||||
::res://assets/::1767410719
|
||||
icon.svg::CompressedTexture2D::347234531240620840::1767410708::1767410719::1::::<><><>0<>0<>cd8caee1c8a7b4b3cbd67faa4c96c3c0<>res://.godot/imported/icon.svg-56083ea2a1f1a4f1e49773bdc6d7826c.ctex::
|
||||
::res://Scripts/::1767411205
|
||||
player.gd::GDScript::4709046051602623302::1767411205::0::1::::<>CharacterBody3D<><>0<>0<><>::
|
||||
::res://Scripts/::1767414773
|
||||
player.gd::GDScript::4709046051602623302::1767414773::0::1::::<>CharacterBody3D<><>0<>0<><>::
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
res://Floor.tscn
|
||||
res://node_3d.tscn
|
||||
res://DevTest.tscn
|
||||
res://Player.tscn
|
||||
res://Scripts/player.gd
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 22,
|
||||
"column": 35,
|
||||
"folded_lines": Array[int]([]),
|
||||
"h_scroll_position": 0,
|
||||
"row": 10,
|
||||
"scroll_position": 0.0,
|
||||
"row": 37,
|
||||
"scroll_position": 24.0,
|
||||
"selection": false,
|
||||
"syntax_highlighter": "GDScript"
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -16,7 +16,8 @@ const jump_velocity = 4.5
|
||||
# ========= Cam Stuff
|
||||
var max_look_up = deg_to_rad(80)
|
||||
var max_look_down = deg_to_rad(-80)
|
||||
|
||||
var crouch_height = 0.6
|
||||
var stand_height = 1.0
|
||||
var pitch = 0
|
||||
|
||||
@onready var camera_pivot = $CameraPivot
|
||||
@@ -29,6 +30,15 @@ func _ready() -> void:
|
||||
mouse_sensitivity = mouse_sensitivity * 0.001
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
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 _unhandled_input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseMotion:
|
||||
@@ -39,6 +49,11 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
camera_pivot.rotation.x = pitch
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
||||
var target_height = crouch_height if is_crouching else stand_height
|
||||
camera_pivot.position.y = lerp(camera_pivot.position.y, target_height, 10 * delta)
|
||||
|
||||
|
||||
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
|
||||
Reference in New Issue
Block a user