Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        float z = joystick.Horizontal;
        float x = joystick.Vertical;

        direction = new Vector3(-x, 0, z);
        direction = mover.ApplyVerticalBoundries(transform.position, direction);
        if (x > 0 || x < 0 || z > 0 || z < 0)
        {
            transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(direction), rotationSpeed);
        }
    }