RegisterBeforeRender function is undefined

RegisterBeforeRender function is undefined

Hello everyone,
I try to create an earthquake game with Babylon js.

For create an earthquake effect I want to rotate my follow camera. like this
https://www.babylonjs-playground.com/#BYG518#1

When I try to do the same thing on my project it throws an error like “Cannot read property ‘rotation’ of undefined”. But if I put the registerBeforeRender is end of the code then it show
“Uncaught TypeError: Cannot read property ‘registerBeforeRender’ of undefined”

If registerBeforeRender function is commented out, then code will work.
My main problem is, why registerBeforeRender function is undefined. Could, anyone tell me what’s the mistake I made in here?

Any help would be ok.
Thank you, everyone.

https://playground.babylonjs.com/#A9MZL8#40 here is
Take care about how you name your variables and where are you using them.
Use the debugger, or many console logs.
And why not, use let/const instead of var
Cheers! :beers:

1 Like

Thank you so much :wave: MarianG

1 Like