There’s several things wrong above. You may wish to start over with an actual tutorial and follow it correctly.
Here’s two issues that will require some rework:
movespeed is a float and yet I see you comparing it for equality. This is a no-no. See below.
you are using GetKeyDown() for what appears to be continuous motion. You should use GetKey() instead
you are manipulating the transform position and rotation and yet I see a Rigidbody and a collision callback. You WILL have physics problems with this approach.
With Physics (or Physics2D), never manipulate the Transform directly. If you manipulate the Transform directly, you are bypassing the physics system and you can reasonably expect glitching and missed collisions and other physics mayhem.
Always use the .MovePosition() and .MoveRotation() methods on the Rigidbody (or Rigidbody2D) instance in order to move or rotate things. Doing this keeps the physics system informed about what is going on.
Floating (float) point imprecision:
Never test floating point (float) quantities for equality / inequality. Here’s why: