Load Object 3D From ImageTarget Prefab (Vuforia)
Hello everyone, Well, I'am developing Augmented Reality application using vuforia. I'm using unity 5.3.1f1 with vuforia 5-0-10 it works well when I defined statically the object 3d which placed below ImageTarget, the object show up when the camera read the marker. Then I want the to define the object3D by script (C#). I've tried put the asset on folder Assets/Resource but it didn't show up when the camera read marker. Here's my script:
Transform myModelTrf = (Instantiate(Resources.Load("Iron_Rod/Iron_Rod")) as GameObject).transform; // note: not .prefab! myModelTrf.parent = mTrackableBehaviour.transform; myModelTrf.localPosition = new Vector3(0f, 0f, 0f); myModelTrf.localRotation = Quaternion.identity; myModelTrf.localScale = new Vector3(500f, 500f, 500f); myModelTrf.gameObject.SetActive(true);
Somebody help me please.
Answer by Umresh · Mar 17, 2016 at 12:44 PM
Your instantiated IronRod is too big to be seen set the local scale in your script to Vector3.one
Astagfirullah,, What the ..., I guess making big size of scale will be easier to see the object then i thought there was something wrong with my code (not the scale problem). Thank you very much.
Your answer
![](https://koobas.hobune.stream/wayback/20220612071837im_/https://answers.unity.com/themes/thub/images/avi.jpg)