Lens works in Studio, not on phone. TypeError: cannot write property 'enabled' of null at [anon] (Script:6) preventsyield
I am getting this error when I start my lens. Its preventing it from working properly on the phone. I cannot figure out for the life of me why its not working. Also, why would it work in Lens Studio, but not on the device?
TypeError: cannot write property 'enabled' of null at [anon] (Script:6) preventsyield
If someone needs the project, I can provide. I brought TeamCelebrate elements into a lens I had made with 2 3D objects.
Please can someone help me with this?
Hi Topher!
Hmm Interesting, it seems like there is no object referenced on line 6 of script.js. Is all the fields in the Inspector panel of the object with script.js filled?
If that's the not the issue, it'd be great if you can share your project so we can take a look and find what's missing.
Thanks in advance!
Jon
Thanks so much for responding Jon! 🙏 Here is a link to the file... https://drive.google.com/open?id=17ZG5wwz8D0iscDnR9Zq_v6LkHHIrf5wQ I had kind of just exported the objects from the team celebrate template and brought them into the 3D objects template. If that helps.
Hi Topher!
Thanks for sharing. So here's what I did:
Since the error mentions script.js causing the issue, in the Resources panel I right click that script and press Find Usage
It pointed me to the TouchCollision object which has this script. It looks like this script has empty fields. Since it's empty I assumed it's not being used? I deleted it and the error goes away. Alternatively, you can fill it in :)
Let me know if you need any clarification!
Cheers,
Jon
Thanks! That fixed it! Must have been left over from when I was trying to make facepaint change on tap.