- Home /
Prefab wont appear in game view but appears in scene view when called from CSV file.
I am new to Unity and am using version 2018.2.10f1 and visual studios.
I am following the AUGMENTED_REALITY_FOR_DEVELOPERS book tutorial chapter 7, 'augmenting the instruction manual'. But using it to work on my own project.
I'm stuck at the portion where the augmented graphic is supposed to be displayed when image target is detected. The prefab is called from the csv file but it does not display in game view but is visible in scene view. Also, the prefab is cloned in hierarchy, i'm not sure if this is supposed to happen. The script that i'm using is the same script given by the book, 'ARGraphic.cs'. Attached is my script and the prefab in scene view which is in yellow and pink.
I'm not sure if my problem is due to the fact that my image target can't be detected, though it has a 5 star rating and a cube displays if i show my image target.
Thanks in advance!
Answer by Kaloid · Jan 08, 2019 at 07:59 PM
The screenshot is very hard to read, but it looks like you have a compiler error (the red text at the bottom) in your console. It's very likely that it is the source of the issue.
Answer by reyking098 · Jan 09, 2019 at 08:43 AM
Hi thank you for replying! I've cleared the error but now when i try to detect the image target, user defined target pops up.
It looks like you need to change the image. That looks like the prefab is being instantiated. On that note, to answer one of your other questions, yes the cloning is normal. Anytime you instantiate a prefab, it will always appear in the hierarchy as "prafab(Clone)".
Are you using a set of downloaded assets? When Unity is missing a texture, it doesn't show something like this, it shows a neon pink texture over the prefab.
If you are using a set of downloaded assets, then that is probably the image or sprite that is its default. You will need to change it in code by defining the primary image, a secondary image, and then swapping them.