- Home /
Accessing Vuforia ARCamera.prefab position from a script
Hi there,
Am fairly new to Unity, and also to Vuforia.. Really loving it and which I had more time to explore it but have a week to make an AR app.
I've created a new project with a scene that has the Vuforia AR libraries in there, it works great, when I hold up a marker to the camera the Image Target's contents (a Particle Emitter and a Collada) are displayed at the correct orientation. So far so good! Amazed at how simple that was!
I'm now trying to make the the particles themselves head towards the ARCamera's location, which shouldn't be too hard but I cant seem to be able to access it in any way (I assume because its a prefab?).. I've got access to the particle emitter and can go through all the particles locations etc...
But I can't find anywhere what class type the ARCamera is, or how I can reference it... tried this:
arc = (Component)(GameObject.Find("ARCamera").GetComponent(typeof(Component)));
which gives this warning:
GetComponent requires that the requested component 'Object' derives from MonoBehaviour or Component or is an interface. UnityEngine.GameObject:GetComponent(Type)
Are prefabs just not accessible, or have I missed something? Any help on this would be much appreciated!