simplified ledge grab
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=46 format=3 uid="uid://drwae3loscbw7"]
|
||||
[gd_scene load_steps=45 format=3 uid="uid://drwae3loscbw7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bieeh1iro4ji1" path="res://scripts/player.gd" id="1_x7wms"]
|
||||
[ext_resource type="Script" uid="uid://linvnr16djav" path="res://scripts/PlayerStateMachine.gd" id="2_1npgd"]
|
||||
@@ -12,7 +12,6 @@
|
||||
[ext_resource type="Script" uid="uid://bgj2bqb5dys41" path="res://scripts/player_wall_running.gd" id="6_1npgd"]
|
||||
[ext_resource type="Script" uid="uid://boyl3qkg4j4vc" path="res://scripts/player_ground_pound.gd" id="7_2asft"]
|
||||
[ext_resource type="AudioStream" uid="uid://bki17g7j4kqn4" path="res://assets/Audio/PickupSound Mixdown 3.wav" id="8_dwqsx"]
|
||||
[ext_resource type="Script" uid="uid://cl8wpx8g1b5ce" path="res://scripts/player_clamber.gd" id="8_iwgew"]
|
||||
[ext_resource type="Script" uid="uid://bb7u0nnktowwp" path="res://scripts/player_on_ladder.gd" id="8_vgdha"]
|
||||
[ext_resource type="Shader" uid="uid://djbvmc8hurccm" path="res://assets/Shaders/speedlines.gdshader" id="10_5hu7c"]
|
||||
[ext_resource type="AudioStream" uid="uid://dyd272r7n2ecd" path="res://assets/Audio/footsteps-shoes-jump-land-beach-sand-SBA-300118001.wav" id="10_tn0pn"]
|
||||
@@ -173,11 +172,6 @@ script = ExtResource("7_2asft")
|
||||
|
||||
[node name="Stunned" type="Node" parent="StateMachine"]
|
||||
|
||||
[node name="Ledge Grab" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("8_iwgew")
|
||||
move_speed = 1.0
|
||||
move_transition_speed = 10.0
|
||||
|
||||
[node name="On Ladder" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("8_vgdha")
|
||||
move_speed = 5.0
|
||||
|
||||
@@ -12,7 +12,7 @@ config_version=5
|
||||
|
||||
config/name="First Person Test"
|
||||
config/tags=PackedStringArray("fps")
|
||||
run/main_scene="uid://dsw00ml8rv6xo"
|
||||
run/main_scene="uid://c6fykssf7paft"
|
||||
config/features=PackedStringArray("4.4", "Forward Plus")
|
||||
config/icon="uid://6svuq1l83al5"
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@ func standard_jump():
|
||||
if character.jumps_remaining > 0:
|
||||
character.jumps_remaining -= 1
|
||||
jump_with_weight_mod()
|
||||
elif is_grabbing_ledge():
|
||||
jump_with_weight_mod()
|
||||
|
||||
func apply_gravity(delta):
|
||||
character.velocity.y -= 9.8 * 1.25 * delta
|
||||
|
||||
@@ -600,7 +600,7 @@ func focus_on_target():
|
||||
camera.attributes.dof_blur_near_enabled = false
|
||||
|
||||
func weapon_tilt(input, delta):
|
||||
if input:
|
||||
if input != null:
|
||||
if !ads:
|
||||
if weapon_holder:
|
||||
weapon_holder.rotation.z = lerp(weapon_holder.rotation.z, -input.x * weapon_rotation_amount * 10, 4 * delta)
|
||||
|
||||
@@ -23,18 +23,13 @@ func Physics_Update(delta):
|
||||
if Input.is_action_just_pressed("crouch"):
|
||||
Transitioned.emit(self,"ground pound")
|
||||
|
||||
if Input.is_action_just_pressed("interact"):
|
||||
character.ledge_collision.disabled = false
|
||||
Transitioned.emit(self,"ledge grab")
|
||||
|
||||
enable_wall_rays()
|
||||
|
||||
if can_wall_run():
|
||||
start_wall_running()
|
||||
|
||||
ledge_grab()
|
||||
standard_jump()
|
||||
|
||||
|
||||
|
||||
func Exit():
|
||||
character.ledge_collision.disabled = true
|
||||
|
||||
@@ -15,3 +15,4 @@ func Physics_Update(delta):
|
||||
Transitioned.emit(self,"crouched")
|
||||
|
||||
standard_jump()
|
||||
ledge_grab()
|
||||
|
||||
Reference in New Issue
Block a user