I’m trying to get a dummy that displays the user in a local script but I can’t figure out how to do it.
So if anyone knows how i can do this it would be alot of help.
So it will show the current players avatar
local player = game.Players.LocalPlayer -- Gets the Local player
local playerModel = game.Players:CreateHumanoidModelFromUserId(player.UserId) -- gets exact player model(R6/R15/RTHO)
playerModel.Parent = workspace -- put model in workspace
Make a part in the room like a player spawn part. Make sure the Front is facing the Menu Camera.
The model’s RootPart may of needed to be Anchored.
Something as so.
Code
local player = game.Players.LocalPlayer
local part = -- put the Part here
local playerModel = game.Players:CreateHumanoidModelFromUserId(player.UserId)
playerModel.PrimaryPart.Anchored = true
playerModel.Parent = workspace
playerModel:PivotTo(part:GetPivot())
Recommendations
Disable Display name on model(also needs to be scripted).
Seat model on chair/play looped animations.
If the model does not spawn in it may be do to network issues or error in the code(check error reports). Best bet is error in the code which I apologize for if so.
Uh one more thing. Is there anything different I have to do for an animation script compared to normal? Because it seems like it would be harder to play animations on it.
Note, the model is client based and only client scripts can interact with it. So play the animation on the client side.
Load Animation Code(Same as normal)
local animation = script:WaitForChild("Animation") -- replace with your anim
local AnimationTrack:AnimationTrack = playerModel.Humanoid.Animator:LoadAnimation(animation) -- : -- this is a check thing
AnimationTrack:Play() -- play as normal
Hope everything works out for ya, and Have a Blessed Day!