The type or namespace name ‘RigidBody2D’ could not be found (are you missing a using directive or an assembly reference?) [duplicate]


using System.Collections; using System.Collections.Generic; using.UnityEngine;

public class Player_Move_Proto : MonoBehaviour { public int playerSpeed = 10; public bool facingRight = true; public int playerJumpPower = 1250; public float moveX;

// Update is called once per frame void Update() {    PlayerMove (); }  void PlayerMove() {     moveX = Input.GetAxis("Horizontal");      if (moveX < 0.0f && facingRight == false){         FlipPlayer ();    }    else if (moveX > 0.0f && facingRight == true) {       FlipPlayer ();           }     gameObject.GetComponent<RigidBody2D>().velocity = new Vector2 (moveX * playerSpeed, gameObject.GetComponent<RigidBody2D>().velocity.y); }  void Jump() {  }  void FlipPlayer() {  } 

}