void SetHoldObject() { HeldItemSmall.transform.parent = SpawnPoint.transform; HeldItemSmall.transform.localPosition = SpawnPoint.transform.localPosition; HeldItemSmall.transform.localRotation = Quaternion.identity; HeldItemSmall.GetComponent <Rigidbody>().isKinematic = true; HeldItemSmall.SetActive(false); Debug.Log("minSize"); holdObjSmall = true; }
void PlaceItemDeactivated() { if (holdObjSmall == true) { if (Input.GetKeyDown(KeyCode.F)) { HeldItemSmall.SetActive(true); ShowCube.Invoke(); } } if (Input.GetKeyUp(KeyCode.F)) { if (Lev == false) { HeldItemSmall.GetComponent <Rigidbody>().isKinematic = false; HeldItemSmall.transform.parent = null; HeldItemSmall.transform.localScale = new Vector3(.2f, .2f, .2f); holdObjSmall = false; PlaceCube.Invoke(); } if (Lev == true) { HeldItemSmall.transform.parent = null; HeldItemSmall.transform.localScale = new Vector3(.2f, .2f, .2f); HeldItemSmall.transform.eulerAngles = new Vector3(0f, 0f, 0f); holdObjSmall = false; PlaceCube.Invoke(); } else { Debug.Log("NoObject"); } } }