public void OnInteract() { if (winLoseScreenButton != null) { winLoseScreenButton.onClick.Invoke(); } BoatCoffin boat = GetBoatCoffin(); if (carriedCorpse == null) { Corpse corpse = GetCorpse(); if (corpse != null) { corpse.ActivateRagdoll(); carriedCorpse = corpse; carriedCorpse.dragspot.GetComponent <Rigidbody>().isKinematic = true; if (carriedItem) { carriedItem.GetComponent <Rigidbody>().MovePosition(throwspot.transform.position); carriedItem.GetComponent <Rigidbody>().isKinematic = false; carriedItem = null; } } } else { carriedCorpse.dragspot.MovePosition(throwspot.transform.position); carriedCorpse.DropCorpse(); carriedCorpse = null; } if (carriedItem == null) { Item item = GetItem(); if (item != null) { Debug.Log("ITEM" + item.name); carriedItem = item; carriedItem.GetComponent <Rigidbody>().isKinematic = true; if (carriedCorpse) { carriedCorpse.dragspot.MovePosition(throwspot.transform.position); carriedCorpse.DropCorpse(); carriedCorpse = null; } } } else { carriedItem.GetComponent <Rigidbody>().MovePosition(throwspot.transform.position); carriedItem.GetComponent <Rigidbody>().isKinematic = false; carriedItem = null; } }