Skip to content

Z.after(...)

Studio is being deprecated, please head over to the documentation page for Mattercraft, our most advanced 3D tool for the web, where you can find the most recent information and tutorials.

Z.after(ms: number, func: () => void): void;

Runs a function after the specified time has passed. This may occur some number of milliseconds beyond the specified interval due to variable frame times.

Parameter Type Description
ms number The number of milliseconds that must have elapsed before the function will be called.
func function The function to be called once the interval has elapsed.
function myFunction(){
//a function to call
}
//call the funtion myFunction after 1000ms (1 second)
Z.after(1000, myFunction);