Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Camera Cframe Position Change is broken?

Asked by 4 years ago

Hello! I have a concern about one of my scripts in a part. It is supposed to teleport you and change your camera viewpoint using a CFrame. The teleportation works. Yet the Camera Change of viewpoint does not change.

function onTouched(part)
 -- Teleport
local h = part.Parent:findFirstChild("HumanoidRootPart")
 if (h ~=nil) then
h.CFrame = CFrame.new(100,100,100)

 end

-- Camera Angle
local target = workspace.LibraryC
local camera = workspace.CurrentCamera
local angle = 0

while wait() do
    camera.CoordinateFrame = CFrame.new(target.Position)
                           * CFrame.Angles(-.5, 0, 0)
                           * CFrame.new(0, 0, 0)
    angle = angle + math.rad(0)
end
end
script.Parent.Touched:connect(onTouched)

Also I have my Camera set as Scriptable

Answer this question