Log in to vote

How do I replace a character with a brick?

Asked by
Perci1 4857 Trusted
3 years ago

I'm trying to replace the default character with a brick that you can move around and control. Here's the hierarchy:

    Brick (Model)
        Health (Script)
        Humanoid (Humanoid)
        Head (Part)
        Torso (Part)
            Mesh (BlockMesh)

Torso is a Part with the size of 4, 2, 2. Head is a Part with the size of 1, 2, 2, attached to Torso with surface welds. Neither part is anchored. I am currently just setting the character through this simple line of code in the command bar.

game.Players.Player.Character = workspace.Brick

Although this does correctly set the character, once my character is the brick I cannot move or jump. I did remove the Animation and Sound scripts normally found in characters because Animation does things that affect the arms and legs, which do not exist, and I have no need for sounds.

Any help is appreciated.

I believe your problem is that when replacing the Character with the brick, you therefore are removing everything inside of the Character. This means that you don't have your humanoid, or your basic Player scripts, hindering you from moving. SlickPwner 539 — 3y
The hierarchy is shown in the first part of the post. Please read it thoroughly. Perci1 4857 — 3y

1 answer

Log in to vote
Answered by
BlueTaslem 16220 Super Administrator
3 years ago

This should work as you've stated (I just tested to be sure)

While they aren't anchored, is it possible that the parts are snapped to other things, like the BasePlate? This sometimes happens it seems when they are created using and the BasePlate is at the origin (though I'm not sure why)

That was the problem, thanks a ton. Perci1 4857 — 3y

Answer this question