My rigid body 2d stops moving instantly after collision although I am still pressing the same moving key

Hi, I am creating a 2d tile game. I have tilemap collider and input system and every thing but when I move for example to the right and collide in to something on the ground or in the air after jumping the player stop moving even if there is nothing that disturb it. So I have to relese the right key button and than press it again. Is there a solution for that?

There always is. Trouble is who knows given the vague description above? Try this pattern:

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is the bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, log output, variable values, and especially any errors you see
  • links to actual Unity3D documentation you used to cross-check your work (CRITICAL!!!)

The purpose of YOU providing links is to make our job easier, while simultaneously showing us that you actually put effort into the process. If you haven’t put effort into finding the documentation, why should we bother putting effort into replying?

If you’re not sure what is happening in your game, fix that first. Here’s how:

Time to start debugging!

By debugging you can find out exactly what your program is doing so you can fix it.

Use the above techniques to get the information you need in order to reason about what the problem is.

You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.