Hard link for objects

Hello,

Does PlayCanvasEngine and GLB model support the pre-set hard links between model elements? For example car doors hinges which will hold car doors hardly linked to car chassis?

And is it possible to use some “real physics” when user will touch the car door and door will not fly because of hard link to chassis and will not fall inside car because there will no enough space, thus door will only moves-opens to external side of the car and close back?

Sample? Code?

Please, help to find appropriate way

Hi @InPro,

There isn’t official support for constraints in a PlayCanvas component, but the underlying physics engine supports them. So you can write some code to get access to that, here you go an example I am aware of:

https://developer.playcanvas.com/en/user-manual/physics/calling-ammo/#joint-constraints

1 Like

Do you just want a door to open like this?

If so, you don’t need physics for this. This can be an animation in the model or as long as the pivot of the mesh instance is in the right place, rotation on the mesh instance.

2 Likes

Yes, similar to this. But can it be animated by code at PlayCanvasEngine scene, not by 3D editor pre-make animation?
Code sample?

No exact example for a car door but as long as the pivot is in the right place, you can do a tween to animate the door opening and closing

https://developer.playcanvas.com/en/tutorials/tweening/

1 Like