Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
28becd88c2 | |||
|
1f9bbd73b3 | ||
|
4c0152e688 | ||
|
2d654f7600 | ||
6257f07766 | |||
|
6a6de243dd | ||
|
669c951a81 | ||
c64deaa27a | |||
be0001e554 |
@ -36,8 +36,8 @@ extends CharacterBody3D
|
|||||||
@export var FORWARD : String = "ui_up"
|
@export var FORWARD : String = "ui_up"
|
||||||
@export var BACKWARD : String = "ui_down"
|
@export var BACKWARD : String = "ui_down"
|
||||||
@export var PAUSE : String = "ui_cancel"
|
@export var PAUSE : String = "ui_cancel"
|
||||||
@export var CROUCH : String
|
@export var CROUCH : String = "crouch"
|
||||||
@export var SPRINT : String
|
@export var SPRINT : String = "sprint"
|
||||||
|
|
||||||
# Uncomment if you want full controller support
|
# Uncomment if you want full controller support
|
||||||
#@export var LOOK_LEFT : String
|
#@export var LOOK_LEFT : String
|
||||||
@ -96,6 +96,7 @@ func _ready():
|
|||||||
check_controls()
|
check_controls()
|
||||||
|
|
||||||
func check_controls(): # If you add a control, you might want to add a check for it here.
|
func check_controls(): # If you add a control, you might want to add a check for it here.
|
||||||
|
# The actions are being disabled so the engine doesn't halt the entire project in debug mode
|
||||||
if !InputMap.has_action(JUMP):
|
if !InputMap.has_action(JUMP):
|
||||||
push_error("No control mapped for jumping. Please add an input map control. Disabling jump.")
|
push_error("No control mapped for jumping. Please add an input map control. Disabling jump.")
|
||||||
jumping_enabled = false
|
jumping_enabled = false
|
||||||
@ -112,7 +113,7 @@ func check_controls(): # If you add a control, you might want to add a check for
|
|||||||
push_error("No control mapped for move backward. Please add an input map control. Disabling movement.")
|
push_error("No control mapped for move backward. Please add an input map control. Disabling movement.")
|
||||||
immobile = true
|
immobile = true
|
||||||
if !InputMap.has_action(PAUSE):
|
if !InputMap.has_action(PAUSE):
|
||||||
push_error("No control mapped for move pause. Please add an input map control. Disabling pausing.")
|
push_error("No control mapped for pause. Please add an input map control. Disabling pausing.")
|
||||||
pausing_enabled = false
|
pausing_enabled = false
|
||||||
if !InputMap.has_action(CROUCH):
|
if !InputMap.has_action(CROUCH):
|
||||||
push_error("No control mapped for crouch. Please add an input map control. Disabling crouching.")
|
push_error("No control mapped for crouch. Please add an input map control. Disabling crouching.")
|
||||||
@ -313,9 +314,9 @@ func headbob_animation(moving):
|
|||||||
# This code is extremely performant but it makes no sense.
|
# This code is extremely performant but it makes no sense.
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if HEADBOB_ANIMATION.is_playing():
|
if HEADBOB_ANIMATION.current_animation == "sprint" or HEADBOB_ANIMATION.current_animation == "walk":
|
||||||
HEADBOB_ANIMATION.play("RESET", 0.25)
|
|
||||||
HEADBOB_ANIMATION.speed_scale = 1
|
HEADBOB_ANIMATION.speed_scale = 1
|
||||||
|
HEADBOB_ANIMATION.play("RESET", 1)
|
||||||
|
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
|
@ -174,17 +174,6 @@ tracks/1/keys = {
|
|||||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
|
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
|
||||||
"times": PackedFloat32Array(0)
|
"times": PackedFloat32Array(0)
|
||||||
}
|
}
|
||||||
tracks/2/type = "bezier"
|
|
||||||
tracks/2/imported = false
|
|
||||||
tracks/2/enabled = true
|
|
||||||
tracks/2/path = NodePath("Camera:position:z")
|
|
||||||
tracks/2/interp = 1
|
|
||||||
tracks/2/loop_wrap = true
|
|
||||||
tracks/2/keys = {
|
|
||||||
"handle_modes": PackedInt32Array(0),
|
|
||||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
|
|
||||||
"times": PackedFloat32Array(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_8ku67"]
|
[sub_resource type="Animation" id="Animation_8ku67"]
|
||||||
resource_name = "sprint"
|
resource_name = "sprint"
|
||||||
@ -212,17 +201,6 @@ tracks/1/keys = {
|
|||||||
"points": PackedFloat32Array(0.05, -0.25, 0, 0.2, -0.01, 0, -0.2, 0.000186046, 0.2, 0.000186046, 0.05, -0.2, -0.01, 0.2, -0.01, 0, -0.2, 0, 0.2, 0, 0.05, -0.2, -0.01, 0.25, 0),
|
"points": PackedFloat32Array(0.05, -0.25, 0, 0.2, -0.01, 0, -0.2, 0.000186046, 0.2, 0.000186046, 0.05, -0.2, -0.01, 0.2, -0.01, 0, -0.2, 0, 0.2, 0, 0.05, -0.2, -0.01, 0.25, 0),
|
||||||
"times": PackedFloat32Array(0, 0.5, 1, 1.5, 2)
|
"times": PackedFloat32Array(0, 0.5, 1, 1.5, 2)
|
||||||
}
|
}
|
||||||
tracks/2/type = "bezier"
|
|
||||||
tracks/2/imported = false
|
|
||||||
tracks/2/enabled = true
|
|
||||||
tracks/2/path = NodePath("Camera:position:z")
|
|
||||||
tracks/2/interp = 1
|
|
||||||
tracks/2/loop_wrap = true
|
|
||||||
tracks/2/keys = {
|
|
||||||
"handle_modes": PackedInt32Array(0, 0, 0, 0, 0),
|
|
||||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
|
|
||||||
"times": PackedFloat32Array(0, 0.5, 1, 1.5, 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_lrqmv"]
|
[sub_resource type="Animation" id="Animation_lrqmv"]
|
||||||
resource_name = "walk"
|
resource_name = "walk"
|
||||||
@ -250,17 +228,6 @@ tracks/1/keys = {
|
|||||||
"points": PackedFloat32Array(-0.05, -0.25, 0, 0.2, 0.005, 0, -0.2, 0.000186046, 0.2, 0.000186046, -0.05, -0.2, 0.005, 0.2, 0.005, 0, -0.2, 0, 0.2, 0, -0.05, -0.2, 0.005, 0.25, 0),
|
"points": PackedFloat32Array(-0.05, -0.25, 0, 0.2, 0.005, 0, -0.2, 0.000186046, 0.2, 0.000186046, -0.05, -0.2, 0.005, 0.2, 0.005, 0, -0.2, 0, 0.2, 0, -0.05, -0.2, 0.005, 0.25, 0),
|
||||||
"times": PackedFloat32Array(0, 0.5, 1, 1.5, 2)
|
"times": PackedFloat32Array(0, 0.5, 1, 1.5, 2)
|
||||||
}
|
}
|
||||||
tracks/2/type = "bezier"
|
|
||||||
tracks/2/imported = false
|
|
||||||
tracks/2/enabled = true
|
|
||||||
tracks/2/path = NodePath("Camera:position:z")
|
|
||||||
tracks/2/interp = 1
|
|
||||||
tracks/2/loop_wrap = true
|
|
||||||
tracks/2/keys = {
|
|
||||||
"handle_modes": PackedInt32Array(0, 0, 0, 0, 0),
|
|
||||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
|
|
||||||
"times": PackedFloat32Array(0, 0.5, 1, 1.5, 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_o0unb"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_o0unb"]
|
||||||
_data = {
|
_data = {
|
||||||
@ -281,7 +248,7 @@ tracks/0/keys = {
|
|||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [Vector3(0.0349066, 0, 0)]
|
"values": [Vector3(0, 0, 0)]
|
||||||
}
|
}
|
||||||
tracks/1/type = "value"
|
tracks/1/type = "value"
|
||||||
tracks/1/imported = false
|
tracks/1/imported = false
|
||||||
@ -393,8 +360,6 @@ HEADBOB_ANIMATION = NodePath("Head/HeadbobAnimation")
|
|||||||
JUMP_ANIMATION = NodePath("Head/JumpAnimation")
|
JUMP_ANIMATION = NodePath("Head/JumpAnimation")
|
||||||
CROUCH_ANIMATION = NodePath("CrouchAnimation")
|
CROUCH_ANIMATION = NodePath("CrouchAnimation")
|
||||||
COLLISION_MESH = NodePath("Collision")
|
COLLISION_MESH = NodePath("Collision")
|
||||||
CROUCH = "crouch"
|
|
||||||
SPRINT = "sprint"
|
|
||||||
|
|
||||||
[node name="Mesh" type="MeshInstance3D" parent="."]
|
[node name="Mesh" type="MeshInstance3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||||
@ -413,7 +378,6 @@ libraries = {
|
|||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
||||||
|
|
||||||
[node name="Camera" type="Camera3D" parent="Head"]
|
[node name="Camera" type="Camera3D" parent="Head"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 0.999391, -0.0348995, 0, 0.0348995, 0.999391, 0, 0, 0)
|
|
||||||
|
|
||||||
[node name="HeadbobAnimation" type="AnimationPlayer" parent="Head"]
|
[node name="HeadbobAnimation" type="AnimationPlayer" parent="Head"]
|
||||||
libraries = {
|
libraries = {
|
||||||
|
@ -65,9 +65,6 @@ uv1_triplanar_sharpness = 0.000850145
|
|||||||
[node name="Character" parent="." instance=ExtResource("1_e18vq")]
|
[node name="Character" parent="." instance=ExtResource("1_e18vq")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||||
|
|
||||||
[node name="Camera" parent="Character/Head" index="0"]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 0.999391, -0.0348995, 0, 0.0348995, 0.999391, 0, 0, 0)
|
|
||||||
|
|
||||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||||
environment = SubResource("Environment_20rw3")
|
environment = SubResource("Environment_20rw3")
|
||||||
|
|
||||||
@ -107,5 +104,3 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.5, 3, -15.5)
|
|||||||
use_collision = true
|
use_collision = true
|
||||||
size = Vector3(19, 8, 1)
|
size = Vector3(19, 8, 1)
|
||||||
material = SubResource("StandardMaterial3D_7j4uu")
|
material = SubResource("StandardMaterial3D_7j4uu")
|
||||||
|
|
||||||
[editable path="Character"]
|
|
||||||
|
Reference in New Issue
Block a user