Reinitializing engine in Playground (TypeScript)

Hi all!

Trying to create a TypeScript Playground with an engine with deterministicLockstep as shown in the Playground:

In TypeScript, I added the lines:

// @ts-ignore
delete engine;
engine = new BABYLON.Engine(canvas, true, {
    deterministicLockstep: true,
    lockstepMaxSteps: 4

However, this gives the error createEngine function must return an engine. as shown in the Playground:

Thank you for your help! :stuck_out_tongue:

to create a difference engine in the playground you will need to define a createEngine function. In typescript it should be a static CreateEngine function that returns an engine. A random example I found -

Not mine, just here to show how it works :slight_smile:


Ah, thank you so much, @RaananW, your solution works great!

1 Like

Just today, the Playground above ( is no longer working due to createScene function must return a scene.

The Playgrounds in Ray/RayHelper incorrectly registering hit were working earlier today, but stopped working just now.


Can be fixed by changing




Do you mind doing a PR to fix the doc?

1 Like

PR made!

You’re awesome! PR approved
A quick question @Deltakosh before merging - the rendering canvas’s ID was changed since the new deployment. Many playgrounds will fail now that the canvas’ id is different - don’t we want to keep the old id to support them?


Please change it. There is no problem

1 Like

Hey! Discussed internally, I am changing the id of the canvas element back to renderCanvas. Your PR is amazingly helpful, but it will need to be re-adjusted to renderCanvbas instead of renderingCanvas. The playground change will be merged later today, will you be update to update the docs after it is available?

Thanks a lot!!!

1 Like

Of course, @RaananW! Looking forward to the changes becoming available :slight_smile:

1 Like

@RaananW, PR created! :slight_smile:

1 Like

Merged! Thanks a lot

1 Like