I’m currently trying to make an online web game using babylon.js on react. So I tried to update the user’s location information using setTargetTransform using web socket. However, when I applied that function, something terrible happened in the physics engine (I’m using havok). setTargetTransform blew up all my characters. Now, I’ve solved the problem by executing setTargetTransform once every 16ms to synchronize it with the render rate, but if hundreds of users send 60 data per second, it’ll be a big problem.
In the meantime, I simply wrote a function using setTargetTransform to move the character to that location when clicked (same logic as playground). The result was the same, the object flew away at a tremendous speed.
As a result, I want to ask the following.
- Why does setTargetTransform do this?
- Is there a good way to update the user’s location without executing setTargetTransform at 60Hz?
- Is there a function that can replace setTargetTransform?
I’ve been struggling with this problem since last week. I would really appreciate it if you guys could help me.