Can I create Custom shapes by scripting in PlayCanvas?

I wonder if I can create parameteric shapes such as Arc, Curve, Box by using script. Each shape will have customized size, rotation and position.
I can’t find any suitable answer anywhere.

Hi @Usman_Hameed and welcome,

Yes, you can use the Mesh API to create custom shapes by providing vertex positions and indices. Here is the full API:

Here is an example using it:

And here is how the engine produces the internal primitives like box and sphere:

1 Like