By MiguelSlim
on Thu, 08/05/2021 - 11:40
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?
Hey there,
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.