Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | unicornsoftwareinc |
Hi there, I’m working on a game (built on top of of one of the isometric samples in Godot) and I’m making slow and steady progress.
However, I’m encountering an issue where everything jitters when the player (KinematicBody2D) collides with certain corners in my tilemap. Specifically, if my character walks straight up into a corner above him, the jittering occurs. Same thing if he walks straight down into a corner below.
It doesn’t happen if the player moves left or right into corners. Here’s a video showing what happens: Imgur: The magic of the Internet
I’m calling the move_and_slide function inside of the _physics_process function of the player KinematicBody2D object. Anyone have any idea of what’s going on and what I might be able to do to fix this?
Thanks!
Could you show the relevant code in your process function please?
DaddyMonster | 2021-12-07 00:25
@DaddyMonster
This is my code:
var motion = Vector2()
motion.x = Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
motion.y = Input.get_action_strength("move_down") - Input.get_action_strength("move_up")
motion.y /= 2
motion = motion.normalized() * MOTION_SPEED
move_and_slide(motion, Vector2.UP, false, 4, PI/4, false)
unicornsoftwareinc | 2021-12-08 20:57