Last active
September 10, 2018 14:25
-
-
Save colormono/7468e1fa890365b4e5be8f2a6f09de2f to your computer and use it in GitHub Desktop.
[LensStudio: Time difference] Tiempo transcurrido desde la última interacción #LensStudio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // -----JS CODE----- | |
| // Variable to store what time particle started | |
| var startTime; | |
| function update() { | |
| if (startTime) { | |
| // Calculate how many seconds have elapsed since we've triggered particles | |
| var ageTime = getTime() - startTime; | |
| print('Age: ' + ageTime + ' seconds.'); | |
| } | |
| } | |
| function start() { | |
| startTime = getTime(); | |
| } | |
| // on update | |
| var eventUpdate = script.createEvent('UpdateEvent'); | |
| eventUpdate.bind(update); | |
| // on start trigger | |
| var triggerUpdate = script.createEvent('MouthOpenedEvent'); | |
| triggerUpdate.bind(start); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment