Access Coords of Facial Features
I am trying to script a "falling" animation for a face lens, whereby an object will fall from the top of the screen and land appear to land on the top of the persons head. I was wondering if there was any way to attain the approximate coordinates of the top of a head (considering the head is moving around, etc.).
Thanks!
Hey Andrew,
You can approximate the head position pretty easily using a Head Binding object.
You can now use this Head Top object's position to approximate the top of the head. For your purpose of playing an animation based on head position, you can use a simple script to move your animation object to the head position every frame.
Add this script under the "Frame Updated" event to a parent object of your animation. Set "target" to the Head Top object created in the earlier steps.
This will update your animation's position without affecting rotation. If you want the animation to always align with gravity, you can try using a Device Tracking component set to Rotation tracking mode.
Hope this helps! Let me know if you have any more questions!
Awesome thank you so much, can't wait to try it out.