Ty_Scripts
(IAmTrulyGreg)
#1
The ViewportFrames aren’t really behaving how they should. I have the character spawn and then I clone it to the ViewportFrame. Code:
wait(0.33)
game.Players.LocalPlayer.Character.Archivable = true
local fakeChar = game.Players.LocalPlayer.Character:Clone()
fakeChar.Name = ""
fakeChar.Humanoid.DisplayName = ""
fakeChar.Parent = script.Parent
local cam = Instance.new("Camera")
script.Parent.CurrentCamera = cam
cam.Parent = script.Parent
cam.CFrame = CFrame.new(Vector3.new(0, 4, -7), fakeChar.Head.Position)
Sometimes it does this:
Other times, with no script changes, it does this:
Can anyone explain what the problem might be here?
1 Like
OiiTaru
(OiiTaru)
#2
I’m not too familiar with Cameras however, it could be due to the CameraType.
I would suggest something like:
local Camera = Instance.new("Camera")
Camera.CameraType =enum.CameraType.Scriptable
Camera.Parent = script.Parent
Camera.CFrame = CFrame.new(Vector3.new(0, 4, -7), fakeChar.Head.Position)
script.Parent.CurrentCamera = Camera
1 Like
On top of what @OlTaru mentioned with CameraType, make sure when you’re cloning the character, that you anchor HumanoidRootPart.
1 Like
Ty_Scripts
(IAmTrulyGreg)
#4
@OlTaru + @Katzenpunk
Still happening, but thanks.
Ty_Scripts
(IAmTrulyGreg)
#5
Fixed. Just needed to set the CFrame of the fakeChar.