- Home /
How to assign XR interaction tool scripts to asset bundles?
I am trying to load asset bundles from server. Before creating asset bundles I attached ARSelectionInteractable,ARTranslationInteractable etc scripts to prefab and then converted to asset bundle but looks like the script does not work when asset bundle is downloaded.
I also tried to attach scripts programmatically once asset bundle is downloaded but doesn't seem to work. Any help
_placementInteractable.placementPrefab = Instantiate(bundle.LoadAsset(rootAssetPath) as GameObject,transform);
_placementInteractable.placementPrefab.AddComponent<BoxCollider>();
_placementInteractable.placementPrefab.AddComponent<ARSelectionInteractable>();
_placementInteractable.placementPrefab.AddComponent<ARTranslationInteractable>();
_placementInteractable.placementPrefab.AddComponent<ARScaleInteractable>();
_placementInteractable.placementPrefab.AddComponent<ARRotationInteractable>();
I am following this eg https://github.com/Unity-Technologies/XR-Interaction-Toolkit-Examples but it only demonstrates already present prefabs eg and not one downloaded from server. I am testing on m iPhone device
,I am trying to load asset bundles from server. Before creating asset bundles I attached ARSelectionInteractable,ARTranslationInteractable etc scripts to prefab and then converted to asset bundle but looks like the script does not work when asset bundle is downloaded.
I also tried to attach scripts programmatically once asset bundle is downloaded but doesn't seem to work. Any help
placementInteractable.placementPrefab = Instantiate(bundle.LoadAsset(rootAssetPath) as GameObject,transform);
_placementInteractable.placementPrefab.AddComponent<BoxCollider>();
_placementInteractable.placementPrefab.AddComponent<ARSelectionInteractable>();
_placementInteractable.placementPrefab.AddComponent<ARTranslationInteractable>();
_placementInteractable.placementPrefab.AddComponent<ARScaleInteractable>();
_placementInteractable.placementPrefab.AddComponent<ARRotationInteractable>();
I am following this eg https://github.com/Unity-Technologies/XR-Interaction-Toolkit-Examples but it only demonstrates already present prefabs eg and not one downloaded from server. I am testing on m iPhone device
Answer by sawantpritish · Apr 24, 2021 at 03:19 AM
I got this working by unchecking the strip code option in Player settings