Topic locked

How to Add Scripts to GameObjects, that are within a Vuforia GameObject

August 5, 2021 - 4:40am #1

I don't understand how I can add scripts to GameObjects that are within a Vuforia GameObject (ImageTarget in this case). When I run the scene, the GameObjects show on top of the imageTarget as expected, but the scripts I attached to them don't run. I have a simple chest on a map, with the following script attached to it:

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using Vuforia;

public class Chest : MonoBehaviour

{

  void Start()

  {

    Debug.Log("hi");

  }

  private void OnMouseDown()

  {

    Debug.Log("hi");

  }

}

Neither the Start, not the OnMouseDown function will print anything in the console. What am I doing wrong?

How to Add Scripts to GameObjects, that are within a Vuforia GameObject

August 5, 2021 - 5:05am #2

Hey there,

The start method should at least be called, even as child object of a target. Could you provide me the project you're working on? You could use Google Drive or WeTransfer and share the link privately (click on my username and click on "Send a Message") or on the forum.

Topic locked