How to properly enable/disable with smile event
Tried the following code but its inconsistent and seems buggy
// -----JS CODE-----
// @input SceneObject[] obj
script.obj[0].enabled = false;
function onSmile() {
script.obj[0].enabled = true;
}
function offSmile(ev) {
script.obj[0].enabled = false;
}
var event = script.createEvent("SmileStartedEvent");
event.faceIndex = 0;
event.bind(onSmile);
var ev = script.createEvent("MouthClosedEvent");
ev.faceIndex = 0;
ev.bind(offSmile);
Hi,
Can you please show us a GIF of what's happening so we can try to solve your problem with the bug :)
Does the code look correct? It just isnt tracking the smile properly if you smile and close mouth twice the smile doesnt seem to trigger again on the second time or its delayed. Also if your head moves off camera filter it can activate mouth closed event. I can't attach a gif because this is a client project.
Hi Josh
Since people have different degrees of smiling, this makes it difficult to discern whether a user is smiling, or it is their neutral state. So, after a few seconds of smiling, the Lens will recalibrate and assume that it is the user's neutral state. This will make it difficult to re-trigger the event the next time. We're working on a better solution for this, and apologize for the inconvenience.
One thing to double check is that for the close event you are using mouth closed rather than "SmileFinishedEvent" .--I just want to make sure that is expected for you.
For your second point, you mean that when your face disappears, "MouthClosedEvent" is sometimes triggered? Can you make a minimal version and share this issue? I haven't been able to reproduce this myself.
Let me know if you need any clarification.
Thanks,
Jonathan
I'm running into a similar issue where the smileEnded event gets triggered after 3 seconds regardless. Is there any way to know if the smileEnded event was triggered by the recalibration or by the camera?