add initial yaw to player controller
This commit is contained in:
parent
89ee4a11a5
commit
41133101d5
|
|
@ -31,6 +31,8 @@ var has_stage: bool = false:
|
||||||
|
|
||||||
@export var mouse_sensitivity: Vector2 = Vector2(6, 5)
|
@export var mouse_sensitivity: Vector2 = Vector2(6, 5)
|
||||||
|
|
||||||
|
@export var initial_pitch: float = 50
|
||||||
|
|
||||||
@export_range (0, 10) var max_speed: float = 3
|
@export_range (0, 10) var max_speed: float = 3
|
||||||
@export_range (0, 10) var max_acceleration: float = 5
|
@export_range (0, 10) var max_acceleration: float = 5
|
||||||
@export_range (0, 20) var damp: float = 10
|
@export_range (0, 20) var damp: float = 10
|
||||||
|
|
@ -103,6 +105,7 @@ func _ready():
|
||||||
ui_prober.area_entered.connect(_on_ray_entered)
|
ui_prober.area_entered.connect(_on_ray_entered)
|
||||||
ui_prober.area_exited.connect(_on_ray_exited)
|
ui_prober.area_exited.connect(_on_ray_exited)
|
||||||
$CrouchDetector.area_exited.connect(exit_crouch)
|
$CrouchDetector.area_exited.connect(exit_crouch)
|
||||||
|
pitch.rotation_degrees.x = initial_pitch
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
friction = 0.0
|
friction = 0.0
|
||||||
|
|
||||||
[sub_resource type="SeparationRayShape3D" id="SeparationRayShape3D_hpoj0"]
|
[sub_resource type="SeparationRayShape3D" id="SeparationRayShape3D_hpoj0"]
|
||||||
length = 1.29801
|
length = 1.5
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_hpoj0"]
|
[sub_resource type="Gradient" id="Gradient_hpoj0"]
|
||||||
interpolation_mode = 2
|
interpolation_mode = 2
|
||||||
|
|
@ -629,7 +629,7 @@ cull_mask = 3
|
||||||
current = true
|
current = true
|
||||||
|
|
||||||
[node name="RayCast3D" type="RayCast3D" parent="Yaw/Pitch/Mount/Camera3D"]
|
[node name="RayCast3D" type="RayCast3D" parent="Yaw/Pitch/Mount/Camera3D"]
|
||||||
target_position = Vector3(0, 0, -1.3)
|
target_position = Vector3(0, 0, -1.5)
|
||||||
collision_mask = 17
|
collision_mask = 17
|
||||||
collide_with_areas = true
|
collide_with_areas = true
|
||||||
|
|
||||||
|
|
@ -639,7 +639,7 @@ collision_layer = 0
|
||||||
collision_mask = 16
|
collision_mask = 16
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Yaw/Pitch/Mount/Camera3D/UiProber"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Yaw/Pitch/Mount/Camera3D/UiProber"]
|
||||||
transform = Transform3D(-1, 0, -8.74229e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0, 0)
|
||||||
shape = SubResource("SeparationRayShape3D_hpoj0")
|
shape = SubResource("SeparationRayShape3D_hpoj0")
|
||||||
|
|
||||||
[node name="TextureRect" type="TextureRect" parent="Yaw/Pitch/Mount/Camera3D"]
|
[node name="TextureRect" type="TextureRect" parent="Yaw/Pitch/Mount/Camera3D"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue