How Do I Assign the Player to a Cube?

So I’ve been trying to make this game in which you can control a cube. However, since the player has to control the cube, I need to replace the player with a cube they can control. I’ve decided that I’ll just make the player invisible, and just use CFrame to constantly move them to the cube’s position, but now I just need to make them able to use the cube.

For this, I’m thinking I need to do something along the lines of assigning the player a cube when they join, and then letting them move the cube around.

The only thing I’m focusing on right now, though, is trying to get the cube assigned to the player. How do I get the player to get the cube? To do a test run, I’m just trying to get the cube to stay above the player’s head, so I know they’re assigned the cube, but I don’t know how to do that.

Any help is appreciated! :smile:

2 Likes

Just make the cube the character, so model it and insert a humanoid. You will probably also have to name it “HumanoidRootPart” and from there you can just program your own movement to suit your needs.

2 Likes

So all you have to do is make a model (i guess call it Cube) insert a Humanoid, then name the cube part HumanoidRootPart and make that the models primary part. Then you only need to set the player.Character = cube

Wouldn’t you need some other parts for it to work?

No you only need what I stated, try it yourself. I’ve done this before also with a box so I know lol

Alright, I just did, and there are some problems:

It set the character to the actual Cube instead of making a duplicate (Can just be solved by making a copy and assigning the character to the copy)

I did work, but then after a few seconds, it got rid of the cube and replaced it with the character model

I did work, but then after a few seconds, it got rid of the cube and replaced it with the character model

You probably should turn off RequiresNeck property in the Humanoid. Should fix it.

I’ve turned it off, but the same error is still happening. I can give you a video if you want.

Are there any other properties I need to adjust?

Can you show the error so I can try and figure out how to fix it?

It keeps telling me I can’t send the video because the file is too big, hold on.

As you can see, I have the script right there, and I’ve turned off RequiresNeck, but it still doesn’t work.

Try Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false) in your code.

You also might need a Torso for company if it still doesn’t work.

What should I use as the torso?

Instance a new part called “Torso” in the cube character, probably weld it to the HumanoidRootPart and make it so it’s the same size and same properties of the HumanoidRootPart, however you will probably have to make the root part CanCollide false and Transparency 1 to make it not look weird.
Make sure both of the parts are in the same position.

I really didn’t know how to explain this so I’m sorry if it looks weird.

I made a Torso with the same size and position as the HumanoidRootPart, welded the torso to the humanoid rootpart (with the HumanoidRootPart being Part1) and made the HumanoidRootPart have a transparancy of 1 and CanCollide on false, and the only difference was that it shaded the cube smooth.

Ok. I found a problem. A major problem. The reason the model was replaced was most likely due to animation errors. Whenever Roblox tries to apply an animation on the player, there’s an error because It needs all the parts for said animation. I think the reason it replaced it was because of that error. Because it ran into the error, it replaced the Cube with my avatar, getting rid of all of the animation errors.

Oh yeah, make sure to like - remove the Animate script from the character whenever it switches. Otherwise it might just error out.

There was no error script in the first place, and even when I checked the error, it said it couldn’t be traced. This might be a built-in Roblox thing.

1 Like