NullEngine collision with object updated by position

Lets say we have a client-server architecture where the server is 50% responsible for the overall game. The player we can say handles their own movement and collision in this respect is calculated on the client. However if the player wants to send a Raycast to another player, this is done on the server.

This works fine for static objects but for dynamic ones like player objects it doesn’t seem to work. The player collider or any collider for that matter seems to stay in the same place and no matter how many position changes i make, the updates seem to change the values on the position, but the collider does not physically move from its original spot. The object collider seems to stay at 0,0,0, even if i have updated it to say 0,10,0

So when the players move around on the client, i check for position change and send to server, but when i raycast on the server to check the player positions, the colliders look as if they have not moved, and appear to be in the same position, even though i update the object position on the server.

Am I missing something here?

//create player object var o = BABYLON.MeshBuilder.CreateBox(id, {height: 6, width: 3, depth: 2.5}, this.scene); o.checkCollisions = true;

```//move player object 
            ob.position = new BABYLON.Vector3(data.x, data.y, data.z);```


you have to manually call obj.computeWorldMatrix() to get everything updated

1 Like