hi so i am trying to make it so on the main menu its shows YOUR char doing a animated pose
how can i do this
- Create a clone NPC of the playerâs character locally
- Create a transparent anchored platform so the clone doesnât fall
- Teleport the clone to the top of the transparent platform locally
- Change idle animation ID to your own animation
how can i clone the players ava locally
I made a demo script for you, experiment with it and customize it however youâd like. Put a local script in game.StarterPlayer.StarterPlayerScripts and paste this code into it. I donât know what condition you want the code to run on, so for this demo I assigned the script to run every time the player presses âGâ. Iâve also included annotations explaining what every line of code does.
game:GetService("UserInputService").InputBegan:connect(function(input) -- Detects player input
if input.KeyCode == Enum.KeyCode.G then -- Run code if G is pressed
local player = game.Players.LocalPlayer.Character -- Assigning the localplayer's character to "player"
local teleportLocation = Vector3.new(0,0,0) -- Change the coordinates to be above the transparent platform
player.Archivable = true -- It's crucial for the archivable property to be enabled to be able to clone the player, this enables that property for the player's character
local clonedPlayer = player:Clone() -- This clones the player and assigns the cloned character to "clonedPlayer"
clonedPlayer.Parent = game.Workspace -- This ensures the clone is summoned into the workspace
clonedPlayer:MoveTo(teleportLocation) -- Teleports the clone to the coordinates assigned by variable "teleportLocation"
end
end)
Youâre trying to add the playerâs character in the UI?
im trying to make a 3d animated r6 version of the players ava
- Add a ViewportFrame to your desired positioned.
- Put the CurrentCamera property inside of the VieportFrame to the camera in the workspace.
- Add a WorldModel into the ViewportFrame.
- Add a dummy inside of the WorldModel.
- Now position your camera to your likings so that the dummy fits well into the ViewportFrame.
- Duplicated the camera and put one inside of the viewportFrame.
- Set the âCurrentCameraâ property in the ViewportFrame to the camera inside of the ViewportFrame.
- Add an Animation inside of the script and change the AnimationID
- Add a localScript inside of the viewportFrame.
Write the following
local player = game:GetService("Players").LocalPlayer
local ViewportFrame = script.Parent
local DummyReference = ViewportFrame:FindFirstChild("World"):FindFirstChild("Dummy")
local animation = DummyReference.Humanoid:LoadAnimation(script:FindFirstChild("Animation"))
animation.Looped = true
local function CreateCharacter(UserID, Dummy) -- getting the player's items
local Appearance = game.Players:GetHumanoidDescriptionFromUserId(UserID) -- getting the appearance
Dummy.Humanoid:ApplyDescription(Appearance) -- applying it to the dummy
end
CreateCharacter(player.UserId, DummyReference)
animation:Play()
Your hierarchy should look somewhat like this;
im like really dumb can you elaborate?
who are you responding to? me or the other guy?
i was responding to you because i dont understand that
I recommend you to watch a YouTube Tutorial about how to use ViewportFrames as it isnât the easiest thing to explain. This for example:
And then once youâve set up your viewportframe like in the video (change the couch with a dummy), read my post and you should understand!
ok so if i replace it with a dummy and add a idle animation to the dummy i dont have to do anything else right
donât forget the scripting! Heâs just explaining how you add a model into a viewportFrame. Youâre gonna use a dummy instead of the couch he used and follow the tutorial clearly. Once thatâs done, read my post and youâll understand
ok so the dummy shows up but when i join the game it shows up blank and does not show the players avatar
like a default r6 dummy shows up in studio then when i go to test it is a blank white square
i have it working but it doesnt show player ava
make sure the dummy is anchored. Also, check the output and tell me if there are any errors related to my code.
the animation cant play if its anchored
i already tried to anchor it and it still did not load i got animation working but player wont load and yes api is enabled
anchor the HumanoidRootPart obviously