The bare minimum for debugging code is having logs. On Snap's Spectacles (2021), that is not built in. Furthermore, the resource to support logging does not work out of the box.
The problem with Snap's official logger is that the field of view is incorrect and the depth is not set an appropriate distance. The prefab in this repository, TextLogger.oprfb
, should be a drag and drop solution ๐
- Open or create a new project in Lens Studio.
- Drag the
TextLogger.oprfb
file to the Resources section of Lens Studio. - Drag the prefab from Resources to the Objects in the scene.
- In any script (except
Log_To_Screen/TextLoggerInput.js
), callglobal.logToScreen("Woohoo!")
to print to the screen. Switch the simulator to the Spectacles to see what it will look like in each eye.
Feel free to use this in any way, without attribution to me, within the (unspecified) licensing requirements of the official code this is based on.