public class playercontrol : monobehaviour
{
public rigidbody rb;
public float moveX=0;
public float moveY=0;
public float speed=10;
void FixedUpdate()
{
moveX=input.GetAxis("Horizontal");
moveY=input.GetAxis("Vertical");
this.rigdidbody.velocity=new Vector 3(moveX,moveY,0)*speed;
}
}
网友评论