Ammo js physics being jerky even though app is running at 60fps

I am creating 3d hall with first person perspective camera movement. I am using ammo js for first person perspective since i need the collosion detection. I have four walls and ground as a physical object and I am mounting camera on top of physical sphere for first person movement. Even though the app is running at 60fps player seems to be jerky. What could be the reason?
Live demo it might take a min to before soething appears on screen.

I am using use-ammo js since I am using react.

Thanks for helping !!!

It’s hard to say without seeing your code. Would you be able to set up a codesandbox? In the meantime you can also try profiling your app in the browser dev tools to see what’s causing the jank.

There’s also a Cannon.js package for React, have you seen it? Not sure how strongly tied to React-three-fiber it is though, if you’re not using that. But you can also use the plane Cannon package which is now maintained here.

Hey, thanks for replying. This is small demo onn codesandbox of what I am doing. Actually I was using cannon but it was having really weird issue and even tried to look for help with cannon issue I did not get any solution so I thought I should try ammo and it worked fine but this is the only issue with ammo

1 Like

it was issue in lib, I mention on use-ammojs’s git issues and author solved it.

1 Like