Quantcast
Channel: Questions in topic: "vuforia"
Viewing all articles
Browse latest Browse all 934

Need help with with Vuforia Script

$
0
0
I am using the below Vuforia script but it has an error Script Name: "Deploy Stage Once" Error: Assets\Scripts\DeployStageOnce.cs(54,51): error CS1061: 'Anchor' does not contain a definition for 'transform' and no accessible extension method 'transform' accepting a first argument of type 'Anchor' could be found (are you missing a using directive or an assembly reference?) using System; using UnityEngine; using Vuforia; public class DeployStageOnce : MonoBehaviour { public GameObject AnchorStage; private PositionalDeviceTracker _deviceTracker; private GameObject _previousAnchor; public static string theRoute; public void Start() { if (AnchorStage == null) { Debug.Log("AnchorStage must be specified"); return; } AnchorStage.SetActive(false); } public void Awake() { VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted); } public void OnDestroy() { VuforiaARController.Instance.UnregisterVuforiaStartedCallback(OnVuforiaStarted); } private void OnVuforiaStarted() { _deviceTracker = TrackerManager.Instance.GetTracker(); } public void OnInteractiveHitTest(HitTestResult result) { if (result == null || AnchorStage == null) { Debug.LogWarning("Hit test is invalid or AnchorStage not set"); return; } var anchor = _deviceTracker.CreatePlaneAnchor(Guid.NewGuid().ToString(), result); if (anchor != null) { AnchorStage.transform.parent = anchor.transform; AnchorStage.transform.localPosition = Vector3.zero; AnchorStage.transform.localRotation = Quaternion.identity; AnchorStage.SetActive(true); } theRoute = "/" + anchor.name + "/" + AnchorStage.name; if (_previousAnchor != null) { Destroy(_previousAnchor); } _previousAnchor = anchor; } }

Viewing all articles
Browse latest Browse all 934

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>