Pet Rescue Template Project
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 Project
The Pet Rescue Sample Scene Project includes 2 scenes.
Original_Scene - The original Pet Rescue which can be found by searching in VIVERSE Worlds. Link
Tutorial_Scene - This scene contains a different iteration of the Pet Rescue. This is the scene that was created using the guides provided below.
Pet Rescue Template Project
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.
Using The Pet Rescue Template Checklist
Setup 3D Environment
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.
Add the 3D model to the scene
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.

Add and configure the collider
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.

Setup Spawn Point
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.
Create a spawn point
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.

Setup Cat Groups
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.
Setup Cat Hiding Positions
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.
Setup 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.
Add the Viverse functionality
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.

Setup Catbox
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.
Setup Random Waypoint Assignment
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.
Configure the RandomWaypointAssignment entity
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.

Test the RandomWaypointAssignment script
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.

Setup Instructions Board With Start Button
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.
Create the start button
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.

Setup Countdown UI
The countdown user interface is already added to the project and configured. The following steps show it was setup and configured.
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.

Setup Scoreboard UI
The scoreboard user interface is already added to the project and configured. The following steps show it was setup and configured.
Create the CatCount
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.

Create the seconds text
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.

Setup GameOver UI
The game over user interface is already added to the project and configured. The following steps show how it was setup and configured.
Setup GameManager
The GameManager object is already added to the template project and configured. The following steps show it was setup and configured.
Setup Quest system
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.
Create a quest
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.

Setup Animations
The animations are already added to the template project and configured. The following steps show how they were setup and configured.
Setup Audio
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.
To add celebration music for completing the quest
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.

Add Viverse functionality for celebration music
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.

Setup Particle Effects
The particle effects are already added to the template project and configured. The following steps show how they were setup and configured.
Last updated
Was this helpful?