Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions player/states/OnGround.gd
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ func process(delta):
state_machine.transition_to("OnGround/Stopped")

func physics_process(delta):
# set the checked ground blend position to player's horizontal speed divided by 10, the running speed
player.anim_tree.set("parameters/OnGround/blend_position", player.horizontal_velocity.length() / 10.0)
# set the checked ground blend position to player's horizontal speed divided by 10, the running speed
# lerp for smooth blending
var new_blend_pos = lerp(player.anim_tree.get("parameters/OnGround/blend_position"), player.horizontal_velocity.length() / 10.0, 0.1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While playing with your changes on my (very choppy) Mac I found the hardcoded 0.1 lerp step to cause a little bit of jerkiness. 10.0 * delta worked much more smoothly, so can you please use that instead?

player.anim_tree.set("parameters/OnGround/blend_position", new_blend_pos)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change the indentation of the affected lines from tabs to spaces? You can do that by selecting the 4 affected lines and hitting Ctrl+i or Cmd+i