public void PickedUp(IPlayerController player) { var allColliders = this.GetComponents <Collider2D>(); foreach (var col in allColliders) { col.enabled = false; } this.transform.SetParent(player.GetPointToAttach()); this.transform.localPosition = Vector3.zero; var playerItemsLayerId = SortingLayer.NameToID("PlayerItems"); sRenderer.sortingLayerID = playerItemsLayerId; if (rigidB != null) { rigidB.isKinematic = true; } }