How to make box collider maximum solid, why it is so soft?
I want box collider was solid
How is your movement coded? Have you tried setting the rigidbody detection to Continuous?
My code to move robot:
transform.Translate(new Vector2(Input.GetAxis(“Horizontal”), 0) * Time.deltaTime * speed);
I solve my problem by using code
rb.velocity = new Vector2(Input.GetAxis(“Horizontal”) * Time.deltaTime * speed, rb.velocity.y);
to move robot
Instead of setting the velocity directly, you should be using AddForce. This will allow the physics system to determine the velocity for your object based on the various forces at play in the simulation.
Make sure you’re doing physics updates in FixedUpdate.
Try this:
rb.AddForce(Vector2.right * Input.GetAxis("Horizontal") * speed, ForceMode2D.Impulse);