Replace Player's Model with a New Model

I’m trying to replace the player with a simple model, just a cylinder in this example.

-- Inside a LocalScript

-- Reference the local player

local player = game.Players.LocalPlayer

-- Get the player's character

local character = player.Character or player.CharacterAdded:Wait()

-- Remove the existing character model

character:Destroy()

-- Create a new part to replace the character

local part = game.Workspace:WaitForChild("PlayerModel")

local humanoid = Instance.new("Humanoid")

humanoid.Parent = part

part.HumanoidRootPart = part

player.Character = part

-- Get the camera following the new model
cam = workspace.CurrentCamera

cam.CameraSubject = part.Humanoid

This was my best guess at how to approach this issue, but this code does not work. I’m struggling to figure out what I could be doing wrong, any feedback would be great.

I’m pretty sure you’re supposed to add your model to StarterPlayer and call it “StarterCharacter”.

I may be wrong. Please correct me if I am incorrect.

NOTE: You cant do this via script and have to do it manually

That definitely did something, so progress I think. The playermodel is now gone, but it does replace the playermodel with my new model. Instead, my character is invisible and cannot move.

I found a potentially useful tutorial for you:

(Tbh I kinda forgot how to make a StarterCharacter too :sweat_smile:)

Oh I’m sorry I thought this one actually showed something else, lemme get another one…

Okay yeah follow up, you do actually need to have a fully rigged character for it to actually be able to move. Sorry about that.

No problem! In that case, I wonder if there are any alternatives to what I’m trying to do? I want the player to be a cube, that’s all.

Maybe I could attach the player to cube, remove their ability to walk, and hardcode in w, a, s, d, to apply a force to the cube. So it moves instead of the player. Thoughts?

1 Like

I was actually about to recommend you removing the default animation script and creating your own keybinds. I think that would be pretty good!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.