I can create and spawn a wooden box from the prefab without a problem, but I'm unable to correctly attach it to another object. In this case I'm trying to make a MiniCopter the parent of the box. I've tried many things including what the Unity documentation says, basically the following:
It seems to work in the sense that If I log the position of the box, and the minicopter, the box's position does follow the minicopter's as it moves, but I can't see or interact with the box. It seems like this should defnitely be possible, but I'm just missing something.
Does anyone know the solution?
var obj = GameManager.server.CreatePrefab("assets/prefabs/deployable/woodenbox/woodbox_deployed.prefab");
obj.transform.SetParent(miniCopter.gameObject.transform);
var ent = obj.GetComponent<BaseEntity>();
ent.Spawn();It seems to work in the sense that If I log the position of the box, and the minicopter, the box's position does follow the minicopter's as it moves, but I can't see or interact with the box. It seems like this should defnitely be possible, but I'm just missing something.
Does anyone know the solution?