☑ Instantiate an entity in runtime

Hello Team,

How can I instantiate an entity in runtime which is there already in hierarchy…?


Well, that tutorial is more about assets than entities, @Dinkelborg_At_C4Real. I’d probably recommend looking at this one:


It clones a ‘house’ entity in the hierarchy and makes many copies (using the pc.Entity#clone function).

A method that has worked quite well for me is to create a place in the hierarchy to store the models I would like to create at runtime.
For example PreFabs and then disable it so that it doesn’t show any of the entities underneath it.

Then in scripts I can use:

var entity = this.app.root.findByName('NameOfEntity');
var newEntity = entity.clone();

Thanks all for the help :slight_smile: