Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How do I replace a character with a brick?

Asked by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

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

Workspace
    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.

0
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 534 — 10y
0
The hierarchy is shown in the first part of the post. Please read it thoroughly. Perci1 4988 — 10y

1 answer

Log in to vote
3
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 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 Instance.new and the BasePlate is at the origin (though I'm not sure why)

0
That was the problem, thanks a ton. Perci1 4988 — 10y
Ad

Answer this question