"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Error ITrackableEventHandler

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,

Try changing the name to DefaultTrackableEventHandler.

Thank you.

Vuforia Engine Support

Hi,

Please change as follows:

public class ShipRecoScript: MonoBehavior, ITrackableEventHandler -> public class ShipRecoScript:DefaultTrackableEventHandler

Thank you.

Vuforia Engine Support

ismaelnascimento01

Fri, 09/18/2020 - 02:47

New form on Unity 2019 and Vuforia 9.x.x

 

if (mTrackableBehaviour)
    mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStateChanged);

 

...

 

ivanbog10

Thu, 10/22/2020 - 18:17

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, 

Did you manage to solve this because I'm having the exact same problem. I have searched everywhere and can't find an answer. 

Attachment