fix: resolve GDScript parse errors in movement states
- state_dash.gd: Basis*Vector4 → Basis*Vector3 (no Vec4 in Godot 4.2) - state_ground.gd: shape_owner_get_shape(0) → (0, 0); typed Variant vars; typed ray/normal - state_slide.gd: same shape API fix + unique shape vars per branch - state_wall_run.gd: split 'and' line into single typed bool expression
This commit is contained in:
@@ -13,7 +13,7 @@ func enter(_data: Dictionary = {}) -> void:
|
||||
machine.register_chain_mechanic("slide")
|
||||
# Lower player capsule
|
||||
var player_node = machine.player
|
||||
var shape: CapsuleShape3D = player_node.shape_owner_get_shape(0)
|
||||
var shape: CapsuleShape3D = machine.player.shape_owner_get_shape(0, 0)
|
||||
if shape:
|
||||
shape.height = shape.height * 0.5
|
||||
|
||||
@@ -39,22 +39,22 @@ func update(delta: float) -> void:
|
||||
machine.on_ground = true
|
||||
var speed := Vector3(vel.x, 0.0, vel.z).length()
|
||||
if speed < params.slide_min_speed or elapsed > params.slide_duration:
|
||||
var shape: CapsuleShape3D = machine.player.shape_owner_get_shape(0)
|
||||
if shape:
|
||||
shape.height = shape.height * 2.0
|
||||
var end_shape: CapsuleShape3D = machine.player.shape_owner_get_shape(0, 0)
|
||||
if end_shape:
|
||||
end_shape.height = end_shape.height * 2.0
|
||||
machine.register_chain_mechanic("slide_end")
|
||||
machine.switch_to("ground")
|
||||
return
|
||||
else:
|
||||
var shape2: CapsuleShape3D = machine.player.shape_owner_get_shape(0)
|
||||
if shape2:
|
||||
shape2.height = shape2.height * 2.0
|
||||
var fall_shape: CapsuleShape3D = machine.player.shape_owner_get_shape(0, 0)
|
||||
if fall_shape:
|
||||
fall_shape.height = fall_shape.height * 2.0
|
||||
machine.on_ground = false
|
||||
machine.switch_to("air")
|
||||
|
||||
if not machine.input_crouch or not machine.input_sprint:
|
||||
var shape3: CapsuleShape3D = machine.player.shape_owner_get_shape(0)
|
||||
if shape3:
|
||||
shape3.height = shape3.height * 2.0
|
||||
var cancel_shape: CapsuleShape3D = machine.player.shape_owner_get_shape(0, 0)
|
||||
if cancel_shape:
|
||||
cancel_shape.height = cancel_shape.height * 2.0
|
||||
machine.register_chain_mechanic("slide_cancel")
|
||||
machine.switch_to("ground")
|
||||
|
||||
Reference in New Issue
Block a user