Adding new Pets
I originally showed how we added our own pets into the game during our Pet Inventory episode, which you may be interested in over a text guide.
Model
The setup of the model we use for our pet is one key factor of this system. Each pet model should be stored inside of the ReplicatedStorage/Pets folder. Along with the storage location, our model setup is quite important as well.
- The model should be named after the pet type, for instance “Crab”.
- The model should have a
PrimaryPart, which generally would be the body of your pet. - Each part of the model aside from the part used as the
PrimaryPartshould be welded to the part you set as thePrimaryPart.- Create a Weld Constraint inside of each part aside from the
PrimaryPart. - Set the
Part0property to thePrimaryPartpart. - Set the
Part1property to the other part aka the part that you created the Weld Constraint inside of.
- Create a Weld Constraint inside of each part aside from the
- Ensure that the
Anchored&CanCollideproperties of each part inside of your model are set to false.
Config
We now need to add our new pet type and its properties to the Pets config module located inside of the ReplicatedStorage/Configs folder. We store all of our pets and their properties inside of the Config variable located in this module.
local Config: { [string]: PetConfig } = {
... -- Represents our other pets
Crab = {
Clicks = 1,
Auto = 1,
MaxLevel = 1,
ClicksPerLevel = 10,
},
}My Pets are Facing the Wrong Direction
If your pets are facing the wrong direction then you’ll want to adjust their orientation. What I’d recommend doing is viewing which direction our current models are facing and then rotate your own to match them.
- Move your pet model and one of my pet models into the Workspace.
- Drag the models close to each other in order to be compare the direction they’re facing.
- Use the rotate tool or the action (Ctrl + R) to rotate your model until it faces the same direction as mine.
- Drag the models back inside of the Pets folder within the Replicated Storage.