Failed to attach BoundigBoxRig to gameobject during play mode on Dev_Working_Branch
Overview
When attach BoundigBoxRig to a gameobject during play mode, an ArgumentException occurs. Because BoungingBox prefab couldn't find in Start();
private void Start()
{
objectToBound = this.gameObject;
//Problem
boxInstance = Instantiate(BoundingBoxPrefab) as BoundingBox;
Bounding box prefab is required to be assigned before play scene...
[Header("Preset Components")]
[SerializeField]
[Tooltip("To visualize the object bounding box, drop the MixedRealityToolkit/UX/Prefabs/BoundingBoxes/BoundingBoxBasic.prefab here.")]
private BoundingBox boundingBoxPrefab;
And the script doesn't retry to get BoundingBoxPrefab after the target is assigned in the runtime.
Steps to reproduce
- Start Play
- Create any object in scene
- Attach component of BoundignBoxRig to it.
- Error ArgumentException: The Object you want to instantiate is null. UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:238) UnityEngine.Object.Instantiate[BoundingBox] (MixedRealityToolkit.UX.BoundingBoxes.BoundingBox original) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:199) MixedRealityToolkit.UX.BoundingBoxes.BoundingBoxRig.Start () (at Assets/MixedRealityToolkit/UX/Scripts/BoundingBoxes/BoundingBoxRig.cs:174)
Unity Editor Version
Unity 2017.2.1.1p4
Mixed Reality Toolkit Release Version
2017.2.1p2 (Dev_Working_Branch)
~~Fixed in #1820~~ It's not.
The problems are same as 2017.2.1.4 RC. Both TwoHandManipulation and BoundingBoxRig require presetting BoundingBox. It cause error when add these componets while play scene because the componets try to refer BoundingBox on Start().
Closing issues older than 180 days. If this is still an issue, please reactivate with recent information.