diff --git a/project/assets/character/player/player.blend b/project/assets/character/player/player.blend index 75dfb5c9..acb6dffd 100644 --- a/project/assets/character/player/player.blend +++ b/project/assets/character/player/player.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3b3bcb37c1a9aa5240db8511264b8c2f3f9a24c163ffd3a75f22ffee463149e7 -size 322240 +oid sha256:5bd574f575b88e6de1812e98dbea2cbfd3d9dc0941f1c68b9494a946ac64e74f +size 321553 diff --git a/project/assets/character/player/player.blend1 b/project/assets/character/player/player.blend1 index 11fcd8f1..46defa5e 100644 Binary files a/project/assets/character/player/player.blend1 and b/project/assets/character/player/player.blend1 differ diff --git a/project/objects/player.tscn b/project/objects/player.tscn index 5c39377a..dd72dca0 100644 --- a/project/objects/player.tscn +++ b/project/objects/player.tscn @@ -10,6 +10,7 @@ radius = 0.4 [sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_f46kd"] [sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_ykyjo"] +fadeout_time = 0.02 [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_vqq2l"] animation = &"hang-clamber" @@ -26,6 +27,8 @@ animation = &"RESET" animation = &"jump" [sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_eqqp1"] +fadein_time = 0.05 +fadeout_time = 0.05 [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_42cpl"] animation = &"hang" @@ -79,7 +82,6 @@ animation = &"wallrun_right" [sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_eqqp1"] [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_uxov2"] -graph_offset = Vector2(-710.9436, -530.98883) nodes/output/position = Vector2(1140, 140) nodes/RunStates/node = SubResource("AnimationNodeStateMachine_3nfmf") nodes/RunStates/position = Vector2(-400, -560) @@ -183,8 +185,9 @@ func _physics_process(_delta : float): var direction : Vector3 = -body.velocity if body.is_on_wall(): direction = body.get_wall_normal() + direction = Vector3(direction.x, 0, direction.z).normalized() if not direction.is_zero_approx(): - last_direction = Vector3(direction.x, 0, direction.z).normalized() + last_direction = direction global_position = body.global_position + Vector3.UP + last_direction * dist_mul " @@ -209,20 +212,18 @@ func _enter() -> int: resource_name = "PlayerLedgeHangAction" script/source = "extends PlayerAction +var wall_normal : Vector3 + func _enter() -> int: + blackboard.anim.set(\"parameters/Ledge/request\", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE) + wall_normal = body.get_wall_normal() + blackboard.character.look_at(blackboard.character.global_position - Vector3(wall_normal.x, 0, wall_normal.z)) return Running func _execute() -> int: - if not blackboard.hang_ray.is_colliding(): - return Fail - blackboard.anim.set(\"parameters/Ledge/request\", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE) var diff : Vector3 = blackboard.hang_ray.get_collision_point() - blackboard.hang_ray.global_position - var direction : Vector3 = -blackboard.character.global_basis.z - if body.is_on_wall(): - direction = -body.get_wall_normal() - blackboard.character.look_at(blackboard.character.global_position + Vector3(direction.x, 0, direction.z)) body.velocity = Vector3(body.velocity.x * 0.7, diff.y * 15., body.velocity.z * 0.7) - var input_dot_wall : float = body.get_wall_normal().dot(blackboard.get_world_move_input()) + var input_dot_wall : float = wall_normal.dot(blackboard.get_world_move_input()) if diff.length() < 0.05 and input_dot_wall < -0.5: return Success return Running @@ -238,6 +239,7 @@ script/source = "extends PlayerAnimationAction func _exit(): blackboard.anim.set(\"parameters/Air/blend_amount\", 0.0) blackboard.anim.set(\"parameters/Wall/blend_amount\", 0.0) + blackboard.anim.set(\"parameters/Ledge/request\", AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT) " [sub_resource type="GDScript" id="GDScript_nmc1l"] @@ -386,7 +388,7 @@ air_blend_speed = 6.0 [node name="HangRay" type="RayCast3D" parent="PlayerModel" unique_id=183285060] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -0.508) top_level = true -target_position = Vector3(0, -1.792, 0) +target_position = Vector3(0, -1.604, 0) hit_back_faces = false script = SubResource("GDScript_f46kd") dist_mul = -0.508