- Edited
@Bimbam How nice! Thank you for the lerp suggestion, I will try that, I like it =)
@TwistedTwigleg Oh I like that! I will try Bimbam's suggetion first but I will also look into your idea!
Thank you very much folks :D
EDIT:
I just wanted to let you guys know that I experimented with both suggestion and sadly the scale.x = -1 causes some issues.
I ended up implementing TwistedTwigleg idea. I added one more Collision Shape to my character and used getnode() to disable / enable what I needed:
func _physics_process(delta): if Input.is_action_pressed("p_right"): velocity.x = SPEED $AnimatedSprite.play("walk") $AnimatedSprite.flip_h = false get_node("CollisionShape2D_h_left").disabled = true get_node("CollisionShape2D_h_right").disabled = false elif Input.is_action_pressed("p_left"): velocity.x = -SPEED $AnimatedSprite.play("walk") $AnimatedSprite.flip_h = true get_node("CollisionShape2D_h_left").disabled = false get_node("CollisionShape2D_h_right").disabled = true else: velocity.x = 0 if on_ground == true: $AnimatedSprite.play("idle")
I've learned something nice today!