Hello!
I saw a post that you can use this.context.physics.gravity
to access the context gravity, but it is not available for me on the newest module. What is the correct way to get context gravity?
by user 450160855611473920
Hello!
I saw a post that you can use this.context.physics.gravity
to access the context gravity, but it is not available for me on the newest module. What is the correct way to get context gravity?
by user 450160855611473920
Should be this.context.physics.engine.gravity now (that part changed to make it easier to tree shake the physics engine and perhaps replace it with another engine at some point)
Do you remember where you read that info?
I tried this.context.physics.engine.gravity
but it is not available too. Is there any other way?
As for the post, I read it from here Discord
Thanks for answering.
by user 450160855611473920
Ah sorry perhaps it wasnt added to the type declaration, that would be a mistake.
Try setting it with this.context.physics.engine.gravity = {x:1, y:0, z:0 }