diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-09-15 10:42:53 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-09-15 10:42:53 -0400 |
commit | 9e90ac41bab8db4038fa4ca3099afd0e85cebe89 (patch) | |
tree | 39d12a0b5c97a038a42ede87e4b93b52c6b9140a /character | |
parent | a2c28a27280c186c2717f303ef52a865da6dd94f (diff) | |
download | game_jam49-9e90ac41bab8db4038fa4ca3099afd0e85cebe89.tar.gz game_jam49-9e90ac41bab8db4038fa4ca3099afd0e85cebe89.zip |
Fix jumping and ladders
Diffstat (limited to 'character')
-rw-r--r-- | character/fps_controller/fps_controller.gd | 2 | ||||
-rw-r--r-- | character/fps_controller/fps_controller.tscn | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/character/fps_controller/fps_controller.gd b/character/fps_controller/fps_controller.gd index a344139..8d5af12 100644 --- a/character/fps_controller/fps_controller.gd +++ b/character/fps_controller/fps_controller.gd @@ -54,7 +54,7 @@ func handle_movement(): velocity.y += gravity if velocity.y < term_velocity: velocity.y = term_velocity - velocity = move_and_slide_with_snap(velocity, Vector3.DOWN, Vector3.UP, true, 4, PI/4, false) + velocity = move_and_slide_with_snap(velocity, Vector3.DOWN if velocity.y <= 0.0 else Vector3.ZERO, Vector3.UP, true, 4, PI/4, false) func _input(event): #Handle mouse movement for camera diff --git a/character/fps_controller/fps_controller.tscn b/character/fps_controller/fps_controller.tscn index d878068..1472f15 100644 --- a/character/fps_controller/fps_controller.tscn +++ b/character/fps_controller/fps_controller.tscn @@ -26,6 +26,8 @@ cast_to = Vector3( 0, 0, -3 ) collision_mask = 2 [node name="ladder_detector" type="Area" parent="."] +collision_layer = 0 +collision_mask = 16 [node name="CollisionShape" type="CollisionShape" parent="ladder_detector"] transform = Transform( 1, 0, 0, 0, -1, -8.74228e-08, 0, 8.74228e-08, -1, 0, 0.0169024, -0.58521 ) |