I am having a problem with character movement in a 2D game. I am creating a randomly generated world with box colliders for walls… The player has a collider and ridgidbody2d on them. When I do player movement I run into one of two problems.
If I use something like
rigidbody2D.transform.Translate(Vector3.up * Time.deltaTime * speed);
then the player movement is smooth but the player seems to bounce on the walls when you continuously run into them.
If I use
rigidbody2D.velocity = new Vector2(0,3);
This solves the collision issue however the movement itself seems jumpy and looks bad. Is there a happy medium to make this work effectively without testing for collision, determining the direction and disabling that movement direction untill a different direction is moved?