My character is being displayed in the ViewportFrame, but I would like it to have the same effect as ROLVe’s MURDER game.
My frame:
Their frame:
My code:
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local viewportFrame = script.Parent:WaitForChild("ViewportFrame")
local char = localPlayer.Character
task.wait(2)
local charclone = char:Clone()
charclone.Parent = viewportFrame.WorldModel
for i, child in pairs(charclone:GetChildren()) do
if child:IsA("Script") or child:IsA("LocalScript") then
child:Destroy()
end
end
print(charclone.Parent.Name)
charclone.HumanoidRootPart.CFrame = CFrame.new(0,0,0)
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local viewportFrame = script.Parent:WaitForChild("ViewportFrame")
local char = localPlayer.Character
task.wait(2)
local charclone = char:Clone()
charclone.Parent = viewportFrame.WorldModel
for i, child in pairs(charclone:GetChildren()) do
if child:IsA("Script") or child:IsA("LocalScript") then
child:Destroy()
end
end
print(charclone.Parent.Name)
charclone.HumanoidRootPart.CFrame = CFrame.new(0,0,0)*CFrame.FromEulerAnglesXYZ(0,math.rad(ROTATIONHERE),0)
I’m assuming you’re trying to rotate it?
Edit ROTATIONHERE on bottom line to -15 or 15 (idk which way is correct lol, but it should work)
I don’t see any reason in the code for decals to not load in VPFs. They work fine for me in worldmodels too.
Have you checked the character’s head to see if the decal is still there? (In the viewportframe worldmodel)
also try this:
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local viewportFrame = script.Parent:WaitForChild("ViewportFrame")
local char = localPlayer.Character
task.wait(2)
char.Archivable = true
local charclone = char:Clone()
char.Archivable = false --archivable might fix some stuff
charclone.Parent = viewportFrame.WorldModel
for i, child in pairs(charclone:GetChildren()) do
if child:IsA("Script") or child:IsA("LocalScript") then
child:Destroy()
end
end
print(charclone.Parent.Name)
charclone.HumanoidRootPart.CFrame = CFrame.new(0,0,0)*CFrame.FromEulerAnglesXYZ(0,math.rad(ROTATIONHERE),0)