控制物体前后左右的移动

    技术2025-09-09  66

    private void Move() { float h = Input.GetAxis("Horizontal"); float v = Input.GetAxis("Vertical"); transform.Translate(new Vector3(h, 0, v) * speed * Time.deltaTime,Space.World); //朝向 transform.rotation = Quaternion.LookRotation(new Vector3(h, 0, v)); float res = Mathf.Max(Mathf.Abs(h), Mathf.Abs(v)); animator.SetFloat("Forward", res); }
    Processed: 0.009, SQL: 9