Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I replace a character with a brick?

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.

2 comments

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.

0

The hierarchy is shown in the first part of the post. Please read it thoroughly.

1 answer

✓ Accepted answer

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)

1 comment

0

That was the problem, thanks a ton.

This discussion is preserved as it was. New answers, comments, and votes are closed.