[SOLVED] Variable not defined problem

So I was attempting to make realistic gravity. And here’s the scripts:
Screenshot 2021-01-26 at 11.33.47 AM
(i put this in default)

Screenshot 2021-01-26 at 11.34.01 AM
(i put this in update)

And here’s the error I got:
Screenshot 2021-01-26 at 11.34.16 AM

can someone help me? (here’s the file: realistic gravity1-26-2021_11-38-05.wick (2.6 KB) )

i’m not experienced with using let, i would use this.yvel = 0 and change the instances of yvel to this.yvel.

and remember that if your gravity is wonky, some things will need to be negative instead of positive and vice versa.

let
Only lives in the declared scope, so it will not be available for outside his onEvent function…

2 Likes

ok, thx for the feedback! im going to fix this so the whole forums can enjoy and use!