Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Read values directly from Unity's ARKit Face Actor Component?

Discussion in 'Scripting' started by psql, Nov 30, 2022.

  1. psql

    psql

    Joined:
    Nov 19, 2015
    Posts:
    10
  2. psql

    psql

    Joined:
    Nov 19, 2015
    Posts:
    10
    (Screenshot of the values im hoping for)
     

    Attached Files:

  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,947
    (I'll assume you exhaustively searched the API for this and didn't find it. I am unfamiliar with the API so I won't even try.)

    Steps to success:

    - find the values you want in the code

    - if they are public, access them via an instance of the script

    - if they are private / protected, modify the code to let you get at it:
    ---> make them public?
    ---> make getters?
    ---> subclass and use the subclass?
    ---> make properties and subscribers you can "listen" to, if that floats your boat

    If you modify package code, it will revert, so often you need to rip all of the code out of the package cache (within Library) and drag it into your project, then remove the package manager link so you don't get duplicates.

    But keep in mind you will need to re-hack the code above should you ever want to update the package.
     
    psql likes this.
  4. psql

    psql

    Joined:
    Nov 19, 2015
    Posts:
    10
    Disclaimer: My engineering chops are novice

    So yea, I combed through the API and couldn't find any methods to query the values, only methods to set the values on a specific type of object.

    No values are public, so I had explored modifying the package code, but it started to feel janky, and you're right - it started to revert itself and I got spooked . At this point is when I decided to make a forum post to see if I was on the right track.

    Tweaking the package doesn't feel very future proof so maybe the best approach is for me to read the values off the game object the script targets as a proxy, and then do stuff with what I scrape...

    Would be nice if the API could expose this tho!!

    Thanks for the reply Kurt

     
    Kurt-Dekker likes this.