Player walks a little bit into wall then gets pushed out again
Hi, I am new to unity and am trying to make a 2D platformer. I have seen others with same (maybe) problem on the forum but the answers they gave there gave me other problems. When the player walks towards a wall they walk a little bit into the wall and then gets pushed straight out again which makes the character look all jittery. I use transform.position = transform.position + new Vector3(moveSpeed * Time.deltaTime, 0, 0); to make the player move and when the camera follows it looks and feels just how I want it to, but then when they walk towards walls I get that problem. I tried changing from transform.position to rigidbody2D.AddForce() and then when it hit the walls it was fine, but it didn't feel the same as using transform.position and the character is all jittery when the camera follows. So when I find a solution to one problem another one occures. And also, when the character jumps it looks jittery. If anyone would be so kind as to help I would really appreciate it. Thank you in advance :) Here's the script (this is from various tutorials):