Main menuGui For your char

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

2 Likes
  1. Create a clone NPC of the player’s character locally
  2. Create a transparent anchored platform so the clone doesn’t fall
  3. Teleport the clone to the top of the transparent platform locally
  4. 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.
image

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

  1. Add a ViewportFrame to your desired positioned.
  2. Put the CurrentCamera property inside of the VieportFrame to the camera in the workspace.
  3. Add a WorldModel into the ViewportFrame.
  4. Add a dummy inside of the WorldModel.
  5. Now position your camera to your likings so that the dummy fits well into the ViewportFrame.
  6. Duplicated the camera and put one inside of the viewportFrame.
  7. Set the “CurrentCamera” property in the ViewportFrame to the camera inside of the ViewportFrame.
  8. Add an Animation inside of the script and change the AnimationID
  9. 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;
Capture d’écran 2023-08-29 à 01.26.03

1 Like

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