Ledge grab tweaks

This commit is contained in:
Dustin 2025-05-31 22:07:56 -07:00
parent f833f1cec7
commit d934c815e0
2 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,7 @@
extends Movement_StateReceiver
export var debug_velocity_controller :bool = false
var parent_request_state_change :FuncRef
var parent_use_primary_item :FuncRef
@ -11,7 +13,9 @@ onready var stamina_component = $"%Stamina_Component"
var state_stamina_cost :Dictionary
func _ready():
if debug_velocity_controller:
velocity_controller.debug = true
#var state_ref :State
#var state_name :String
#state_name = 'jump'
@ -326,6 +330,8 @@ func _state_process_physics_hurt():
func _state_process_physics_fall():
flip_sprite_to_movement_direction()
var foo = $"%LedgeDetector".is_colliding()
var bar = $"%WallDetector".is_colliding()
if $"%LedgeDetector".is_colliding() and !$"%WallDetector".is_colliding():
#print("it touched me!")

View File

@ -124,6 +124,7 @@ __meta__ = {
[node name="Movement_StateReceiver" parent="." index="2"]
script = ExtResource( 6 )
debug_velocity_controller = false
[node name="Modifier_Receiver" parent="." index="3" instance=ExtResource( 35 )]
callable_state_machine = NodePath("../Movement_StateMachine")
@ -132,14 +133,14 @@ debug_receiver = true
[node name="LedgeDetector" type="RayCast2D" parent="." index="4"]
unique_name_in_owner = true
modulate = Color( 0, 1, 0, 1 )
position = Vector2( 8, -10 )
position = Vector2( 6, -10 )
enabled = true
cast_to = Vector2( 1.36422e-12, -1 )
cast_to = Vector2( 4, -1 )
[node name="WallDetector" type="RayCast2D" parent="." index="5"]
unique_name_in_owner = true
modulate = Color( 0, 1, 0, 1 )
position = Vector2( 6, -16 )
position = Vector2( 6, -18 )
enabled = true
cast_to = Vector2( 4, 4 )