|
|
@ -178,7 +178,11 @@ public class ParentBehaviour : MonoBehaviour |
|
|
|
parentDialougeObj.GetComponent<Image>().sprite = Sprite.Create((Texture2D)_displayGraphic, new Rect(0.0f, 0.0f, _displayGraphic.width, _displayGraphic.height), new Vector2(0.5f, 0.5f), 100.0f); |
|
|
|
|
|
|
|
//yeet child back to centre of room
|
|
|
|
//child = collision.collider.gameObject
|
|
|
|
Debug.Log("ParentBehaviour.OnCollissionEnter: Yeet Back Child"); |
|
|
|
GameObject lastHeldPlayer = collision.collider.gameObject.GetComponent<YeetHandle>().lastHeld; |
|
|
|
float yeetBackForce = 15f; |
|
|
|
Vector3 yeetBackVelocity = (-1 * lastHeldPlayer.transform.forward * yeetBackForce) + lastHeldPlayer.transform.up * yeetBackForce; |
|
|
|
collision.collider.gameObject.GetComponent<Rigidbody>().velocity = yeetBackVelocity; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|