// Update is called once per frame
    void Update()
    {
        tiempo = tiempo + 1 * Time.deltaTime;
        if (Input.GetKeyDown(KeyCode.G))
        {
            //hips.transform.position = animatedM.transform.position;
            //hips.transform.position += new Vector3(0, .9f, 0);
            //transform.rotation = animatedM.transform.rotation;
        }



        /*  if (!dead)
         * {
         *    //myRag.gameObject.SetActive(true);
         *    //myRag.gameObject.SetActive(false);
         *
         *
         *    myRag.transform.position = animatedM.transform.position;
         *
         *    //hips.transform.position = animatedM.transform.position;
         *    //hips.transform.position += new Vector3(0,.9f,0);
         *    transform.position = animatedM.transform.position;
         *
         *    transform.rotation = animatedM.transform.rotation;
         *    //myRagController.GetUpImmediate();
         *
         * }*/
        /*
         *      if (dead)
         *      {
         *          //myRag.gameObject.SetActive(false);
         *          //myRag.gameObject.SetActive(true);
         *
         *          myRagController.GoRagdoll("manual");
         *
         *          //myRagController.GetUpImmediate();
         *          //myRagController.GoRagdoll("manual");
         *          animatedM.transform.rotation = transform.rotation;
         *          //animatedM.transform.position = myRag.transform.position;
         *          animatedM.transform.position = hips.transform.position;
         *
         *      }*/
        cam2.transform.position = hips.transform.position;

        /*if (logicaPer.tirado && !myRagController.isGettingUp)
         * {
         *  animatedM.transform.position = hips.transform.position;
         * }*/
        /* if (Input.GetMouseButton(0))
         * {
         *   float bulletForce = 4;
         *   RaycastHit hit;
         *   Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         *   if (Physics.Raycast(ray, out hit))
         *   {
         *
         *
         *       //add force to it's rigidbody
         *       hips.GetComponent<Rigidbody>().AddForceAtPosition(ray.direction.normalized * bulletForce / Time.timeScale, hit.point, ForceMode.VelocityChange);
         *   }
         *  // hips.GetComponent<Rigidbody>().AddForce(ray.direction.normalized * bulletForce, ForceMode.VelocityChange);
         * }   */
        if (Input.GetKeyDown(KeyCode.F))
        {
            //toggleDead();
            //myRagController.ragdoll.RepairBones();
            ragdoll.gameObject.SetActive(true);
            animatedM.gameObject.SetActive(false);

            //nav.enabled = false;
            // myRagController.GoRagdoll("manual");
            myRagController.GoRagdoll("");
            logicaPer.tirado         = true;
            logicaPer.armaDisparo    = false;
            refrescoCaido            = tiempo + 4f;
            logicaPer.rb.isKinematic = true;
            logicaPer.rb.isKinematic = false;
        }
        if ((controles.aButton || controles.spacebar) && logicaPer.tirado && !myRagController.isGettingUp && logicaPer.ragdollSuelo && refrescoCaido <= tiempo)
        {
            //toggleDead();
            //myRagController.ragdoll.RepairBones();
            //myRagController.StartGetUp();
            animatedM.transform.position = hips.transform.position;
            ragdoll.gameObject.SetActive(false);
            animatedM.gameObject.SetActive(true);
            //nav.enabled = true;
            //myRagController.ragdoll.RepairBones();
            //myRagController.GetUpImmediate();
            myRagController.StartGetUp();

            logicaPer.x = 0;
            logicaPer.y = 0;
            logicaPer.Move();
            logicaPer.puedoMoverme = false;
            logicaPer.anim.SetBool("tocarSuelo", true);
            //logicaPer.refrescoLevantarse = logicaPer.setCooldown(2.5f);
        }
    }