pacman collisions

Hi, I want to make a game like pacman, but i can’t get the pacman character to stop when he hits the walls. I set him as a rigidbody2d set to kinetic and the walls as colliders but he always passes through them. If i turn off kenimatic it works, but he keeps falling down from gravity. How can i get him to be stopped by walls, but still float in space like pacman?

Thanks!

You could try having his position as a Vector2 (use the arrows to change the variables), using a Raycast2D to check for collisions all around him, and then stopping him from going through things when he detects a wall.

I ended up using a 3d sphere for pacman since it has the use gravity checkbox. I didn’t need to make it kinetic and he doesn’t fall anymore.