Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

C# Script for Vuforia with UI PANEL and BUTTON HELP

Discussion in 'Scripting' started by Ejaay, Aug 21, 2019.

  1. Ejaay

    Ejaay

    Joined:
    Aug 21, 2019
    Posts:
    13
    I am sorry BEGINNER HERE!
    I do have Multiple Targets on my hierarchy
    I wanted to give INFO to my First Image Target

    Brief Explanation:

    1. Scanning the Image Target then shows 3dObject or Video
    2. A Button appears when 3Dobject or Video is showed
    3. The Button is called INFO ( using a PANEL to show the information of the First Target )
    when button is tapped it will show the PANEL of INFO

    QUESTION: How can i show the specific Panel of INFO from a specific Image Target by the camera ("THE INFO is TOGGLED in a button) and NOTE: I have multiple targets



    Hope someone can help!
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      51.6 KB
      Views:
      116
    • 2.PNG
      2.PNG
      File size:
      48.9 KB
      Views:
      100
  2. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,524
    You can either setup the image targets prior to building, i.e. in the editor. Each target can then have an object associated which carries the information (for example an object at that position for visuals, some images or videos), or just an object carrying a component with data that you'd like to process for that particular target.

    That's the easiest way, but also the most inflexible, as it basically limits the information you can process as the "mapping" needs to be available at build-time. This is most useful for testing / prototyping or when there is only a specific set of predefined targets to recognize for your content.

    If that's all you need, you can associate the images / videos with your image targets in the editor. There are components shipped with the Vuforia plugin that enable you to handle events such as found, lost, etc.

    It's not very flexible when the app's actual purpose is to display a variety of post-generated content, such as "let the client/user associate information X with target Y via a configuration" and similar approaches.

    Based on the vague description and the images, I assume that you don't want to set up this before building the app, so you need to load the targets / data sets at runtime using Vuforia's API. Targets can be supplied via a variety of ways, from "built-in" (built into your app) targets, via streaming assets and asset bundles, loading them from the cloud ...

    The targets will then need to carry some information that serves as an indicator / identifier for information you want to show. This could be the targets name for example. You then resolve the information that you need to display for a recognized target via the target's ID, for example.

    This involves quite some work though. If you're a beginner in Unity and in C#, this can turn out to be a difficult task. If you already know C# , getting this to work is rather an easy task, but might still require a few days to come up with a system that does what you want.
     
    Ejaay likes this.
  3. Ejaay

    Ejaay

    Joined:
    Aug 21, 2019
    Posts:
    13


    Thanks for the time in responding to my post. Yes i do understand your suggestion of showing the information through a target.


    I can maybe work on that if i can't resolve the problem.


    But anyway is it possible to bring out Information to a certain Target using a button(named INFO button)? Like for example i have 3 image targets A, B and C. When Image Target A track is found clicking INFO button will show the Panel Window(a description of the Image Target A) same as for the Image Target B and C.

    Hopefully i can get a sample of codes or maybe a reference to research or study this type of task.