Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

Applying gravity to a conn.js body

A topic by sheep_knight created May 04, 2016 Views: 251 Replies: 2
Viewing posts 1 to 3

Hello !

I wanted to make that a cannon body would fall while in mid-air, by using gravity. I found the world.gravity.set method. That doesn't do anything, so here is the code, if you see something that I did wrong.

awake() {

let world = new CANNON.World();



PS : I already looked at the doc, but didn't found anything :'(

thanks to at least read my post:)

Nevermind !I finally found a way :

First, I Set the world in the class, not in the awake method.

Second : use ";" in your update method so the world will apply the gravity correctly every 60 frames per second.

So yeah...

Have a nice day though !

Or just do :