hello dears
I am trying to create the following scripts, with the ITrackableEventHandler, but it shows error CS0246 "Assets\Scripts\ShipRecoScript.cs(6,46): error CS0246: The type or namespace name 'ITrackableEventHandler' could not be found (are you missing a using directive or an assembly reference?)".
Version Unity: 2019.3.9f1 (64-bit) Vuforia version: 9.1.7
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Vuforia;
public class ShipRecoScript: MonoBehavior, ITrackableEventHandler
{
private TrackableBehavior mTrackableBehavior;
void Start ()
{
mTrackableBehaviour = GetComponent <TrackableBehaviour> ();
if (mTrackableBehaviour)
{
mTrackableBehaviour.RegisterTrackableEventHandler (this);
}
}
public void OnTrackableStateChanged (
TrackableBehaviour.Status previousStatus,
TrackableBehaviour.Status newStatus)
{
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED ||
newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
{
// move the boat
// Debug.Log ("move");
MoveScript.current.MoveShip ();
}
else
{
// return the boat to its place
MoveScript.current.ResetShip ();
// Debug.Log ("return");
}
}
}
Hi,
Hi,
Try changing the name to DefaultTrackableEventHandler.
Thank you.
Vuforia Engine Support
I still have the same problem
I still have the same problem. It does not work.
Hi,
Hi,
Please change as follows:
public class ShipRecoScript: MonoBehavior, ITrackableEventHandler -> public class ShipRecoScript:DefaultTrackableEventHandler
Thank you.
Vuforia Engine Support
When i change i get an error
When i change i get an error like this
But what are you supposed to
But what are you supposed to replace RegisterTrackableEventHandler with?
Hello Vuforia Team,
Hello Vuforia Team,
And what to do with RegisterTrackableEventHandler?
New form on Unity 2019 and
New form on Unity 2019 and Vuforia 9.x.x
if (mTrackableBehaviour)
mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStateChanged);
...
Hello, I am building an app
Hello, I am building an app and I actually found a code on the net to load scene after image target is detected but I have error in this code.
Hi,
Hi,
Did you manage to solve this because I'm having the exact same problem. I have searched everywhere and can't find an answer.
I'm hvaing the exact same
I'm having the exact same problem and I can't find a solution for the life of me