[SOLVED] Collision issue when rigidbody.teleport

Hello, when i replace an object with rigidbody.teleport the collision is shifted from the model, so the player bump onto invisible obstacle and go through the model, why is that?
https://launch.playcanvas.com/898756?debug=true (to test go toward the chariot on the bottom right corner)
https://playcanvas.com/editor/scene/898756 (editor link)

Hi @ayrin! As far as I know rigidbody.translate is not a valid way to move a rigidbody.

https://developer.playcanvas.com/en/api/pc.RigidBodyComponent.html

Sorry i meant teleport. The strange issue seems to pop up just with the chariot model and now with the houses, that’s strange.

I see the problem in your game.

You mean the model of the player? How do you know that the collider is shifted from the model?

No i meant the model of the horse and chariot, if i set the collision as dinamic the teleport work, with static it doesn’t, i still have some issue though because the horse model has 3 childs, and the whole pack isn’t teleported as one with dinamic rigidbody, i will work on it more to find a solution

And what about setting the rigidbody type to kinematic? I think that’s the best option in this case.

If all models are always moved together in the same setup, I would use a parent entity with a rigidbody and collision component and all models as a child entity.

If the rigidbodies of the children can be kinematic they will move with the parent if the parent moves. So in that case the children can have it’s own components and you only use the parent to move them at once.

Yes kinematic children with static flag on model works fine, thanks a lot @Albertos

1 Like