Moving the collision when translating an object

Hi,

I’ve got a sliding door in my project and I can’t seem to move the collision box it has with the entity itself.
I’m using a translateLocal on the entity.
Is there a similar function for moving the collision?

See doorswitch.js in https://playcanvas.com/project/583952/overview/platformer

Cheers and thanks!

As it has a rigidbody, you have to use physics functions to move it (adding forces, setting the velocity etc). https://developer.playcanvas.com/en/api/pc.RigidBodyComponent.html

1 Like