The forum on this site is closed for new comments and posts. Continue the conversation in our Snap AR Discord server.

Add alpha property to scene object

  • Hi Marco,

    There's a few issues with your approach right now.

    1. The script API isn't working because the widget script needs to run on the first frame to set itself up. If you disable it before it has a chance to run, it won't initialize itself and the API won't be ready when you call it. The issue you're seeing is not that the script loses all methods, it actually never had a chance to create them in the first place. You can fix this by making sure your script runs after the widget script, so that it disables the widget after it's been initialized. You can do this by running your script in Lens Turn On instead of Initialized, or waiting until a later frame, or by putting your script further down in the scene hierarchy since scripts run in that order. You could even run it in the first Update or LateUpdate if you really have to.

    2. Right now you're disabling the ScriptComponent, not the SceneObject. Disabling the ScriptComponent will just stop the script from running, it won't actually disable any visuals or child objects. Disabling the SceneObject will disable all components, including visuals, and any child objects. You can disable the SceneObject instead like this: toggle.getSceneObject().enabled=false;

    From my experience, enabling/disabling the SceneObject after the script has been initialized works well for hiding and showing UI elements. Let me know if this isn't working for you, and I'll help you find a solution.

    Jacob

    Comment actions Permalink
  • Jacob, I think this doesn't really answer the title of the post. All elements should have an Alpha value. This will allow for smooth fade on's and off's of any and all elements you may want to do that with. Right now you can only do this with images. Text and 3D objects should have this capability for sure. I am sure there are things I am not thinking of off the top of my head.

    It's a pretty frustrating limitation.

    Comment actions Permalink

We're here to help! We just need a little bit of information...

What system are you using?

Have you downloaded the latest version of Lens Studio?

Please download the latest version of Lens Studio. If you still run into this issue, please come back and report it!

Is this issue causing Lens Studio to crash?

What system do you run Lens Studio on?

Version

Graphics

Follow the next steps to help us solve your issue:

  • Copy and paste this text into your TerminalCommand Window
    open ~/Library/Preferences/Snap/Lens\ Studio/ %LOCALAPPDATA%\Snap\Lens Studio Copy Text
  • Press ReturnEnter to run the command. The Lens Studio folder will automatically open
  • Prepare to upload your files: zip the "Log" Folder by right-clicking and choosing "compress."
    Locate the Log.txt file right above it.

    Attach a screenshot of the issue:

Name:

Email:

What is this most relevant to?

Please enter a brief description of your issue:

Thanks for submitting this issue.

Unfortunately, it's likely due to the operating system or hardware you're using – since they don't meet the system requirements for Lens Studio.

Still, we hear you loud and clear, and are logging the issue in case there's ever a workaround we can provide!

Minimum Requirements

Operating System: Windows 10 (64 bit); MacOS 10.11+

Hardware: Minimum of Intel Core i3 2.5Ghz or AMD Phenom II 2.6Ghz with 4 GB RAM; Intel HD Graphics 4000 / Nvidia GeForce 710 / AMD Radeon HD 6450 or better; screen resolution of 1280x768 or higher

We'll try to resolve this issue as soon as possible. Thanks for letting us know about it!

Keep an eye out for a followup email from us. We may have a couple more questions for you, or we might already have a solution to offer.

Happy creating!