Unity-Technologies / XR-Interaction-Toolkit-Examples

This repository contains various examples to use with the XR Interaction Toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to assign XR interaction tool to asset bundles?

BraveEvidence opened this issue · comments

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 would also love to know this ... was thinking that I can hook to the placement event of the generic prefab and just attach the loaded asset as child and extend the colliders boundaries to the child gameobject.