private void OnTriggerStay2D(Collider2D collision) { if (collision.gameObject.tag == "ragdoll") { insideBone inBone = collision.GetComponentInChildren <insideBone>(); RagdollDrag rdd = collision.gameObject.GetComponent <RagdollDrag>(); if (inBone && rdd) { if (inBone.hasBone && !rdd.isHeld) { pressed = true; if (collision.gameObject.transform.position != snapPos.position) { if (collision.gameObject.GetComponent <RagdollDrag>()) { collision.gameObject.GetComponent <RagdollDrag>().StickTo(snapPos); } } Vector2 size = fill.size; size.y += 0.1f; if (size.y < 4.5f) { size.y = 4.5f; } fill.size = size; } } } }
//Vector3 previousMousePosition; //Vector3 mouseDisplacement; // Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); bone = GetComponentInChildren <insideBone>(); }