📅  最后修改于: 2022-03-11 14:49:05.504000             🧑  作者: Mango
public class realguymoves : MonoBehaviour //the class of object
{
//movement
float speed;
float horizontal;
float vertical;
Vector3 moveDirecion;
float drag;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
horizontal = Input.GetAxisRaw("Horizontal"); //getting the horizontal axis of the object
vertical = Input.GetAxisRaw("Vertical"); //getting the vectical axis of the object
moveDirecion = transform.forward * vertical + transform.right * horizontal;
}