Make physics bodies support parenting

This commit is contained in:
Nick 2023-03-26 17:01:45 -04:00
parent 28df733eab
commit e536ab2d23

View File

@ -33,6 +33,7 @@ public class AddPhysics : MonoBehaviour
var bodyGo = new GameObject($"{name}_Body"); var bodyGo = new GameObject($"{name}_Body");
bodyGo.SetActive(false); bodyGo.SetActive(false);
bodyGo.transform.parent = transform.parent;
bodyGo.transform.position = transform.position; bodyGo.transform.position = transform.position;
bodyGo.transform.rotation = transform.rotation; bodyGo.transform.rotation = transform.rotation;