Can we create destructible terrain PlayCanvas?

Hello,

Can we create destructible terrain PlayCanvas?

In any case 3d or 2d?

If yes then How?

Hi @Ketan_ATA,

It’s not supported as a feature, but you can build it using the the Mesh API. Both for 3D and 2D terrains you could update the vertices by removing / displacing them based on a brush. Then you could update the terrain mesh and regenerate a rigid body shape if required.

Check this example on how to deform a surface: PlayCanvas Examples

It’s not an easy task since it involves good knowledge of how meshes work. An alternative if you don’t require physics would be to do this in a vertex shader.

2 Likes

Thanks @Leonidas for quick reply… :slight_smile:

Is there any Sample project link to Fork it?

1 Like

I don’t think so, at least not one that I am aware of :innocent:

1 Like

you could also render those circles of damage to a texture and mask your 2d terrain with it. But again, it’s super easy.

2 Likes