Skip to content

Commit a77370c

Browse files
authored
Player: Move and slide in physics process (#2030)
Change the player and player_hook scripts to move and slide the player in `_physics_process()`, rather than in `_process()`. Fix #2025
1 parent 912d94d commit a77370c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

scenes/game_elements/characters/player/components/player.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ func is_running() -> bool:
184184
return input_vector.length_squared() > (walk_speed * walk_speed) + 1.0
185185

186186

187-
func _process(delta: float) -> void:
187+
func _physics_process(delta: float) -> void:
188188
if Engine.is_editor_hint():
189189
return
190190

191-
# While pulling the grappling hook, the movement is handled in PlayerHook._process.
191+
# While pulling the grappling hook, the movement is handled in PlayerHook._physics_process.
192192
if player_hook.pulling:
193193
return
194194

scenes/game_elements/characters/player/components/player_hook.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func get_ending_area() -> HookableArea:
273273
return areas_hooked[-1]
274274

275275

276-
func _process(delta: float) -> void:
276+
func _physics_process(delta: float) -> void:
277277
if not is_instance_valid(hook_string):
278278
return
279279
if pulling:

0 commit comments

Comments
 (0)