How to remove the function from scene.registerBeforeRender

Hello Babylonjs family.

I am creating a fluctuating light intensity effect.
PG -

Now i want to remove this effect on say, a button click.

Please help me out! :sweat_smile: :pray:

You could be using scene.unregisterBeforeRender(func).
I made an example of this
Light intensity Cycles | Babylon.js Playground (

Now you can pause or replay the light animation with a click of the mouse


wow… @qq2315137135 , Thanks a lot. :smile: :smile: