in games like team fortress 2 there is a little viewport at the bottom left where you can see your character moving around, i’d like to replicate that but i have a few issues:
-
the welding for the tool is broken
-
animations for the tool and character are only visible when you’re in first person
-
easy first person (a smooth arms movement script im using) interferes with the arms, which looks weird
-
cloned character has a “ghost” sometimes
--Objects
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local worldModel = script.Parent:WaitForChild('ViewportFrame'):WaitForChild('WorldModel')
--Services
local RunService = game:GetService('RunService')
--Variables
local CharacterCF = CFrame.new(1.60000014, 2.90000057, 0.600000024, 1, 0, 0, 0, 1, 0, 0, 0, 1)
--Code
RunService.RenderStepped:Connect(function()
if worldModel:FindFirstChild(Player.Name) then
worldModel:FindFirstChild(Player.Name):Destroy()
end
local Clone = Character:Clone()
for _, v in ipairs(Clone:GetDescendants()) do
if v:IsA('Script') or v:IsA('LocalScript') or v:IsA('ModuleScript') or v:IsA('Sound') then
v:Destroy()
end
end
Clone:SetPrimaryPartCFrame(CharacterCF)
Clone.Parent = worldModel
end)
video:
any help is appreciated.