using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class move : MonoBehaviour
{
public float speed = 10.0f;
public Rigidbody rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
//横の入力 -1 ~ 0 ~ 1
float h = Input.GetAxis("Horizontal");
//縦の入力 -1 ~ 0 ~ 1
float v = Input.GetAxis("Vertical");
//前後に移動
rb.velocity = transform.forward * v * speed;
//rb.velocity = transform.forward * v * speed;
//rb.velocity += transform.right * h * speed;
//回転
transform.Rotate(0, h, 0);
}
}