Creating Rigid Bodies in Code
Open Project ↗
Open Project ↗
This project uses clone() function on the Entity to randomly generate a level from Entities that have been created in the Editor.
Usually you will be creating Entities via the PlayCanvas Editor, building up collections of Components and scripts to create the various parts of your game. However, in some cases it is convenient to create Entities in your scripts. This tutorial shows you how.
This project uses the pc.Mesh API to procedurally generate and texture a rolling hillside from a heightmap texture.