Some please help im doing a project in unity that deals with ground plane and voice control ai WIT.ai but my script is broken something do to with the anchor is not responding pro
Error #1) Assets\Scripts\DeployStageOnce.cs(50,42): 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?)
Error #2) Assets\Scripts\DeployStageOnce.cs(56,27): error CS1061: 'Anchor' does not contain a definition for 'name' and no accessible extension method 'name' accepting a first argument of type 'Anchor' could be found (are you missing a using directive or an assembly reference?)
Error #3) Assets\Scripts\DeployStageOnce.cs(63,21): error CS0029: Cannot implicitly convert type 'Vuforia.Anchor' to 'UnityEngine.GameObject'
This is the deploy stage once script, without this script being fixed i cannot continue, none of my other scripts run and im using the latest Unity 2018.3.6f1
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<PositionalDeviceTracker>();
}
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;
}
}
Hello,
I'm not familiar with the script DeployStageOnce.cs.
Is it packaged with any of the Vuforia sample applications?
Thanks,
Vuforia Engine Support