aitor
aitor

Reputation: 2735

Error migrating from cannon.js to cannon-es

I have a world with cannon.js physics working fine. When I try to migrate to cannon-es I get an error in the step() function:

Uncaught TypeError: bodies[i].integrate is not a function

The step() function is:

this.physicsWorld.step(1 / 60, this.experience.time.delta, 3)

And the docs for the step() function: https://pmndrs.github.io/cannon-es/docs/classes/world.html#step

I can't find anything wrong. What does that error means?

console error bodies[i].integrate is not a function

Upvotes: 0

Views: 366

Answers (1)

aitor
aitor

Reputation: 2735

I forgot to import cannon-es instead cannonjs in one file, so I was using a mix of two libraries.

Upvotes: 0

Related Questions