Custom Characters

Custom Characters

Roblox provides a default human character for all games, but you can use any model you want for player characters. For this game, the player will pilot a ship made out of basic parts.

Creating Player Ships

All characters require a HumanoidRootPart to function as a character. The HumanoidRootPart is used to move characters around the world. The model for the ship will be made out of two parts. The main body of the ship will be the HumanoidRootPart. The second part will be made out of a sphere for the ship’s blaster.

Making Different Ships

If you chose to make the ship out of parts other than just one part, you might need to modify the given code to make everything work.

  1. Under Workspace, add a Model.
Creating Models

Models are used to group multiple parts or objects into a single object.

  1. Rename the model StarterCharacter. Make sure the capitalization is the same, since it will be used in the code.
  2. Inside of the StarterCharacter model, add a Part renamed HumanoidRootPart, and a Part renamed Blaster. Make sure to capitalize the parts the same as the image below.

Set the Primary Part

For the model to be able to move, the primary part for the model for the model needs to be set. In this case, the primary part will be HumanoidRootPart.

  1. Select the StarterCharacter Model.
  2. In the Properties window, set the PrimaryPart by clicking on PrimaryPart and then select HumanoidRootPart.

Put the Ship Together

The ship and blaster need to be placed at the center of the arena, and then scaled up a little. If the model is not placed at the center of the arena, it won’t work spawn properly. Instead of dragging the ship around, move the ship to precisely the right place by using the Properties window.

  1. Select HumanoidRootPart.
  2. In the Properties window, next to Position, type 1,4,0 to center it in the arena. Make sure to use commas to separate the values.
  1. To make the ship larger, change the size to about 8,8,8. It’s okay if your ship size is slightly different.
  1. Before positioning the Blaster, make sure Collisions are turned off.
  2. Position the Blaster at 1,4,-4 and set size to 4,4,4.
  1. Change the BrickColor of HumanoidRootPart and Blaster to what you want the ship will look like. Make sure each part’s material is Plastic.
Why Set Materials to Plastic?

If parts are plastic, you may get issues moving the ship. Materials in Studio have set densities, so a concrete player might move slowly, while a plastic one (with a lighter material) will move as intended. To use alternative materials, adjust player speed variables later in the series to compensate for the material.

  1. Now that the ship is made, playtest to see what happens.

That doesn’t look good. Looks like the parts aren’t connected to each other.

Weld The Blaster to the Ship

To fix the problem at hand, glue the parts together using a WeldConstraint between the blaster and HumanoidRootPart.

  1. Stop the playtest.
  2. In the Explorer, under Workspace, add a WeldConstraint.
  1. Drag the WeldConstraint object to the Blaster in the StarterCharacter model.
  1. Under WeldConstraint, in the Properties window, set the Part0 to Blaster.
  1. Set the WeldConstraint’s Part1 to HumanoidRootPart.
  1. Playtest again and make sure the parts are welded together.

Spawning Custom StarterCharacters

Models for player characters need to be moved under StarterPlayer. If the model isn’t moved, the player’s Roblox avatar will spawn instead.

Move into StarterPlayer

  1. Move the StarterCharacter model to StarterPlayer to overwrite the default player model. Once moved, the ship should disappear from the game window.
  1. Playtest the game to see the new custom character. The ship will fall from the sky.

Overwrite Default Scripts

Roblox will add certain default scripts for every player that joins the game. This saves time when developing a standard Roblox game, but causes problems with custom games like this one. For this game, replace the health, sound, and animation scripts.

  1. In the Explorer > StarterPlayer > StarterCharacterScripts add three Scripts. Rename them:
    • Animate
    • Health
    • Sound
Don’t worry about adding code to these scripts, simply making them overrides the defaults.

Troubleshooting the Custom Character

Check the following if your ship isn’t spawning when you click Play Now.

The ship Model:

  • Is named StarterCharacter.
  • Has two parts named HumanoidRootPart and Blaster.
  • Has HumanoidRootPart set as the primary part.
  • Is centered in the middle of the arena.
  • Has been moved to ServerStorage.

These documents are licensed by Roblox Corporation under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Roblox, Powering Imagination, and Robux are trademarks of Roblox Corporation, registered in the United States and other countries.

Previous Intro and Setup Next Top-Down Camera