void OnTriggerStay2D(Collider2D col) { if (col.gameObject.layer == LayerMask.NameToLayer("player")) { rb.drag = drag; FakeChild fakeC = col.GetComponent <FakeChild>(); // if (fakeC != null) // transform.parent.parent = fakeC.fakeChild; } }
void OnTriggerEnter2D(Collider2D col) { if (col.gameObject.layer == LayerMask.NameToLayer("player")) { FakeChild fakeC = col.GetComponent <FakeChild>(); //if (!onTopList.Contains(col.transform)) // onTopList.Add(col.transform); if (fakeC != null) { transform.parent.parent = fakeC.fakeChild; } rb.drag = drag; } }