Unityの教科書2019の通りやってもキャラが横移動しなくなりました
2Dの横スク作ってます
public class PlayerController : MonoBehaviour
{
Rigidbody2D rigid2D;
float jumpForce = 680.0f;
float walkForce = 30.0f;
float maxWalkSpeed = 2.0f;

// Use this for initialization
void Start()
{
this.rigid2D = GetComponent<Rigidbody2D>();
}
void Update()
{
//左右移動
int key = 0;
if (Input.GetKey(KeyCode.RightArrow))key = 1;
if (Input.GetKey(KeyCode.LeftArrow)) key = -1;

float speedx = Mathf.Abs(this.rigid2D.velocity.x);