cursor cannot active and deactive when click ui

by marul arifin   Last Updated June 13, 2019 06:13 AM

I have a player with a third person character controller component. i have a problem with the cursor lock it hide and cannot click the ui button. i already try some coding but error. SORRY Im very2 NEWBIE IN CODING IN UNITY

protected virtual void CharacterInit() { cc = GetComponent(); if (cc != null) cc.Init();

        tpCamera = FindObjectOfType<vThirdPersonCamera>();
        if (tpCamera) tpCamera.SetMainTarget(this.transform);


        Cursor.visible = false;
        Cursor.lockState = CursorLockMode.Locked;
    }
Tags : unity c#


Related Questions


Updated July 02, 2019 11:13 AM

Updated July 12, 2015 13:05 PM

Updated July 13, 2015 13:05 PM