Creating separate levels

Is there a way to do this with packs?

Anyone know how to do this? Maybe an example game? @dave?

Usually for most games, we recommend building all the levels in the same scene and then enabling/disabling the individual level Entities.

Only if your game is going to be very large would we recommend loading separate scenes. There is away to do this, you can make requests for Packs/Scenes in the code and it will load the new hierarchy. I’m aware that this code is likely to change in the near future so I’m hesitant to document it here unless you think you won’t be able to use the enable/disable method above?

So an entity is like a group that can have many components?

Pretty much.

An Entity is a object with a position/rotation/scale (a “transform”). You attach Components to Entities and that gives them extra behaviour. e.g. Add a model component to an Entity and it can render a 3D model at it’s position. Add a script component and you can write your own scripts to give that Entity new behaviours.

Entities can also have child Entities. So your Scene is made up from a tree of Entities, starting at a single “root” Entity.

1 Like

So I would totally like some info on how to use these Scenes, the API doesn’t give much on how to use them or manage them.

It becomes quite a hassle to manage multiple levels when you have to test levels for gameplay. Maybe an advanced tutorial on managing entities when working with many levels, and testing levels for gameplay.

Have you seen the loadSceneHierarchy API?

http://developer.playcanvas.com/en/api/pc.Application.html#loadSceneHierarchy

Basically you can load the entity/component hierarchy from other scenes using this method.

2 Likes