This document provides a guide for creating a Pet Rescue replica project.
The Pet Rescue game is a treasure hunt style game in which the avatar is placed in a 3D environment and has to search for multiple cats. The user navigates the world with their avatar and uses the mouse button to click on the cats to capture them. The game includes a quest system, scoreboard, timer and many other features that can be useful for creating games in VIVERSE. Read up on Pet Rescue here. Download the project and import the zip file into PlayCanvas.
Pet_Rescue_Sample_Scenes_1.0
Sample Project Version: 1.0
PlayCanvas Extension Version: 3.44.1
Pet_Rescue_Template_Project_1.0
The Pet Rescue Sample Scene Project includes 2 scenes.
Original_Scene - The original Pet Rescue which can be found by searching in VIVERSE Worlds.
Tutorial_Scene - This scene contains a different iteration of the Pet Rescue. This is the scene that was created using the guides provided below.
Template_Scene - A stripped down version of Pet Rescue. The 3D environment and colliders have been removed and all the Pet Rescue core game mechanics have been left in the scene to help creators do what they do best, BUT FASTER! Read through the checklist below. The components listed as Required will need to be created and/or configured. The components marked as Optional are already added and configured in the project, but only need to be modified if the creator wants to customize.
A 3D environment needs to be added to the template project. The basic process is in the following guide, but the process can differ based on projects.
The spawn point is already added to the template project, but needs to be configured for a desired Position and Rotation. The following steps show how it was setup and configured.
A. In the Hierarchy, add a new entity.
B. The spawn point's name is arbitrary, but the spawn-point tag needs to be added.
C. Update the Position and Rotation so that the location is above the ground.
D. At this point, the game can be published to VIVERSE for testing, ensuring that the avatar can traverse the environment.
The cat groups are already added to the template project, but groups can be added or removed as needed. The following steps show how they were setup and configured.
The cat hiding positions are already added to the template project, but hiding positions can be added or removed as needed. Moving and rotating the cat hiding positions is recommended as opposed to moving and rotating the cat models.
The cat models are already added to the template project, but cat models can be added or removed as needed. The following steps show how they were setup and configured.
The Catbox is already added to the template project, but needs to be configured for a desired Position, Rotation and Scale. The following steps show how it was setup and configured.
The random waypoint assignment object is already added to the project and configured. It can be customized if cats or cat groups are added or removed. The following steps show how it was setup and configured.
The instructions board with start button object is already added to the project and configured. The following steps show how it was setup and configured.
The countdown user interface is already added to the project and configured. The following steps show it was setup and configured.
The scoreboard user interface is already added to the project and configured. The following steps show it was setup and configured.
The game over user interface is already added to the project and configured. The following steps show how it was setup and configured.
The GameManager object is already added to the template project and configured. The following steps show it was setup and configured.
The quest system is already added to the template project and configured, but quest tasks can be modified, added or removed. The following steps show how it was setup and configured.
The animations are already added to the template project and configured. The following steps show how they were setup and configured.
The audio files are already added to the template project and configured, but the project can be customized to play different sounds and music. The following steps show how they were setup and configured.
The particle effects are already added to the template project and configured. The following steps show how they were setup and configured.
A. Locate the 3D model's Template file inside the folder that was generated by the 3D model that was added to the Assets window.
B. Drag the Template file to the Hierarchy. In the sample project, lights were added to the model.
C. Update Position, Rotation and Scale of the model.
A. In the Hierarchy, create a new entity for the collider.
B. Add a Collision component.
C. Change the collision type to Mesh.
D. Add the Render file to the Render Asset.
E. Add a Rigidbody component.
F. Update the Position, Rotation and Scale in order to match up the collider with the model.
A. For each cat, drag the Template from the Assets window to a hiding position in the Hierarchy.
B. Select the cat in the Hierarchy.
C. Update the Scale for the cat model so the size is appropriate for the environment.
A. For each cat, add a NotificationCenterSubscribeEntityPicking trigger with throttle in ms set to 1600.
B. Add a EntityDisable action with delay in ms set to 2000.
C. Add a EntityEnableById action with the pick up specify execution entity set to the corresponding cat in the cat box. For cat 1, select cat_1_collect, for cat 2, select cat_2_collect, etc.
A. Create a new entity called RandomWaypointAssignment and add the RandomWaypointAssignment script to it.
B. Place a checkmark on the DebugMode checkbox for testing.
C. Add the number of groups to the Array Size box. In the sample, there are 4 groups. Add each of the 4 groups to the Waypoint Group Entity boxes. Add the number of cats in each group to the Random Entity box. Add each cat from the Cats entity to the boxes below the Random Entity box.
A. Publish the project to VIVERSE to test the script. Click the Reset button to confirm the cats are being placed in the appropriate locations. Remove the checkmark placed on the DebugMode checkbox on the RandomWaypointAssignment script to prevent the dialog box from showing in-game.
A. Under the GameInstructionsBoard entity, create a new button called StartButton. Remove the Text entity that is created under the button.
B. Update the Position, Rotation and Scale so the button fits appropriately on the board.
C. On the Button component, change Transition Mode to Sprite Change.
D. Add the 3 button sprites.
E. Add a Collision component and resize it using Half Extents.
Add the CountDown.mjs script to the project
A. Drag the CountDown.mjs script to the Assets window.
B. Select the CountDown.mjs script and click the Parse button.
A. Create a Text Element entity under the Scoreboard entity and name it CatCount.
B. Change the Position to (44, 0, 0) for X, Y and Z.
C. Update the Preset to Left Anchor & Pivot.
D. Add the SFProText-Regular.ttf font to the Font slot.
E. Change the Text field to 0/9.
F. Change Font Size and Line Height to 16.
G. Change the Color to FAF5CD.
A. Create a Text Element under the Stopwatch entity and name it Sec.
B. Update the Position to (35, 0, 0) for X, Y and Z.
C. Update the Preset to Left Anchor & Pivot.
D. Add SFProText-Bold.ttf font to the Font slot.
E. Change the Text field to 00.
F. Change Font Size and Line Height to 20.
G. Change the Color to FAF5CD.
A. Create a new Image Element entity under 2D Screen.
B. Change the Width to 240 and Height to 177.
C. Add the congrats-bg.png texture to the Texture slot.
A. Add a new Quest and name it Pet Rescue.
B. For Quest Description, add the text:
It's lunchtime, but the cats are still hiding around...Quickly find them, click them, and bring them back to their cat tree hideout.
C. Add a new Task and for the description, add the text: 9 cats, how many can you find?
D. Change the Task type to progressBar.
E. Update Progress Steps to 9.
A. For each cat, create a new entity under it. Rename it to cat1, cat2, etc.
B. Add the Sound component and change Max Distance to 50.
C. Rename the Slot 1 to cat1, cat2, etc. Add the cat1.wav, cat2.wave, etc. to the Asset slot.
A. Drag Quest_Complete.mp3 to the Assets window.
B. Create a new Sound entity and name it QuestComplete.
C. Uncheck Positional and set Volume to .5.
D. Update the Name slot to celebrate, add the Quest_Complete.mp3 to the Asset slot and change Volume to .8.
A. On the QuestComplete entity, add the NotificationCenterSubscribe trigger and celebrate to the notification name to subscribe.
B. Add the EntityPlaySound action, add celebrate to sound name to play and add the QuestComplete entity to the pick up specify execution entity.
Sample Project Version: 1.0
PlayCanvas Extension Version: 3.44.1














































































