- Home /
How to check which gameobject was clicked in Vuforia?
I'm making a project for one of my classes using Vuforia. In short, there are 3 target images and each image spawns 3 cubes with different symbols on them. One person knows the correct symbol and must verbally describe it to the other player. Player clicks on 3 correct symbols, they win. 3 incorrect guesses, game over.
I have set up to where each set of symbols will randomly select the correct symbol of that set, set up the scene transitions, animations, etc. The hurdle I'm struggling with is how to check what game object was clicked to add to either the correct guess counter or the incorrect guess counter and then change that cube's color to signify to the player if it was a correct or incorrect guess.
How would I do what is essentially:
private void OnMouseDown(){
if(objectClicked == CorrectSymbol){
correctGuess++;
objectColor = green;
}else{
wrongGuess++;
objectColor = red;
}
Your answer
Follow this Question
Related Questions
How to Hide or mask the image target after tracking ??? 0 Answers
Is currently possible to compile a Vuforia example into UWP and execute it as a standalone app? 0 Answers
How can I live stream 360 video on Unity? 0 Answers
how to changes color of the 3rd gameobject by colliding and destroying 1st and 2nd gameobjects 1 Answer