Deprecated Script Functions


I have have written some JavaScript code in a script tab, and noticed some of the functions are crossed out and say ‘deprecated’ when I hover over them. For example, these functions are deprecated, among others:

These are listed in the API linked to from the Script tab (by pressing the i in a circle). Is there a more updated API I should be using?

Current space:

Hi @lpancoast!

The API on the site is indeed a little outdated. Here some changes relevant for your space.

We moved all sound related methods to Sound namespace:

Sound.load(id, callback)

Also, schedule and other time related methods are under Time namespace now.


Some get* / set* methods were replaced with properties. For example items now have an opacity and color properties:

// This is how you can set an opacity 
item.opacity = 0.5
// This is how you can get an opacity
let opacity = item.opacity

For color we also introduced a dedicated class Color:

cube.color = new Color(255, 0, 0);
let color = cube.color

Hope this helps!


This is great!

What is the new way to do Space.showSceneNavigation(false); ?

Is there an updated API somewhere, or is it still a WIP?

Hi @lpancoast,

To hide the space navigation you can use the following code snippet

GUI.HUD.sceneNavigationVisible = false;

Hope that helps! The API linked in the API website is quite old, we’re looking into updating it in the future :slight_smile:


Is there an updated API somewhere? I am running into a ton of issues with deprecated JS functions and can’t seem to find documentation on all of them.