I am currently creating a online vr world with multiplayer, so i used networked a-frame to create the multiplayer world and i am using aframe-physics-system to create physics. But when i add a synchronized object with dynamic-body this doesnt get synchronized by the server so only the creator of the object can move it around.
<a-assets>
<template id="sphere">
<a-entity class="sphere">
<a-sphere color="blue"></a-sphere>
</a-entity>
</template>
</a-assets>
<a-entity dynamic-body position="0 3 -10" id="sphere" Networked="template:#sphere;attachTemplateToLocal:True"></a-entity>
<!--Collide event-->
<script>
AFRAME.registerComponent('foo', {
init: function() {
this.el.addEventListener('collide', function(e) {
console.log('Player has collided with ', e.detail.body.el);
e.detail.target.el; // Original entity (playerEl).
e.detail.body.el; // Other entity, which playerEl touched.
e.detail.contact; // Stats about the collision (CANNON.ContactEquation).
e.detail.contact.ni; // Normal (direction) of the collision (CANNON.Vec3).
});
}
})
</script>