Hello fellow Devs!
Im trying to make something similar to this: https://gyazo.com/b4c7839b373d172a67a870731d47a6e9 but I can’t find out how they made it. I tried Viewport frames and cloning the character but It gave me errors.
Tips:
- Clone the character in the server
- Deatfully the “Archibable” property of the character is false (turn it true)
*Insert a world model in the viewport frame and put the character under it.
Would this be correct?
Also how would I play it? I tried using Play() but it does nothing.
Yes, use the functions Play with the anim in a animator descendant of the character Humanoid.
Also add a camera and set the viewportframe camera as it.
Could you give me some code? Sorry Im pretty new to scripting with UIs. I dont really understand how I would code that.
Example:
Character:FindFirstChildOfClass("Humanoid"):FindFirstChildOfClass("Animator"):LoadAnimation(Animation):Play()
You want it to appear with the players character or with always same cahracter?
I want the exact Character I put in it. For testing im using mine
local Gui = script.Parent
local Character = Gui:WaitForChild("ViewportFrame"):WaitForChild("WorldModel"):WaitForChild("Archimides233")
local Animation = script:WaitForChild("Animation")
local Camera = Instance.new("Camera")
Camera.Parent = Character.Parent.Parent
Gui.ViewportFrame.CurrentCamera = Camera
Camera.CFrame = Character.HumanoidRootPart.CFrame +Vector3.new(0,3,-6)
Camera.CFrame = CFrame.lookAt(Camera.CFrame.Position, Character.Head.Position)
IMPORTANT: Maybe I wrote some things bad since im making this code in the web, if the variables are bad writed with a letter or smt like that, just change them.
@Archimedes233 , any doubt?
It gives me an warning: “Infinite yield possible on ‘Players.Archimedes233.PlayerGui:WaitForChild(“ViewportFrame”)’” and it doesn’t work but gives me zero errors…
Put the script under the Gui, esle it won’t work (I scripted it to be directly descendant of the Gui)
And the animation under the script
It works! Thank you so much for helping me! Ill mark it as the solution now!
Have a nice day and enjoy de model!
One small question could you give me a Vector3 so my character is infront of it? Sorry if im bothering you! @Rooilo0
Sure, wait
local Character = Gui:WaitForChild("ViewportFrame"):WaitForChild("WorldModel"):WaitForChild("Archimides233")
local Animation = script:WaitForChild("Animation")
local Camera = Instance.new("Camera")
Camera.Parent = Character.Parent.Parent
Gui.ViewportFrame.CurrentCamera = Camera
Camera.CFrame = Character.HumanoidRootPart.CFrame +Vector3.new(0,3,-6)
Camera.CFrame = CFrame.lookAt(Camera.CFrame.Position, Character.Head.Position)
weird, any error shows in the output?
Have you changed the character name?
I changed it and now it works! That you for your patience!