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

Camera dont move when i reset my Character?

Asked by 6 years ago

Camera stop moving when i reset my character. Its my own isometric camera

-------------------------------------------------------------------
repeat wait() until game.Players.LocalPlayer.Character
----------------------------------------[?????????]----------------------------------------
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local character = player.Character

----------------------------------------[????????]----------------------------------------
camera.CameraType = Enum.CameraType.Scriptable
camera.FieldOfView = 20
character.Humanoid.WalkSpeed = 16
local rotate = 0
local debuging = false
----------------------------------------[???????]----------------------------------------
function cameramove ()
    workspace.CurrentCamera.CFrame = CFrame.new(character.HumanoidRootPart.Position)*CFrame.Angles(0,math.rad(rotate),0)*CFrame.new(Vector3.new(50,100,50),Vector3.new(character.HumanoidRootPart.Position))
end
function rotatechange(input,event)
    if input.KeyCode == Enum.KeyCode.E then

        for i = rotate,rotate+90,10 do 
            rotate = i
            wait()
        end
        debuging = false
    end
    if input.KeyCode == Enum.KeyCode.Q and debuging == false then
        debuging = true
        for i = rotate,rotate-90,-10 do 
            rotate = i
            wait()
        end
        debuging = false
    end
end



----------------------------------------[??????]----------------------------------------
game:GetService("RunService"):BindToRenderStep("Camera",Enum.RenderPriority.Camera.Value,cameramove) -- ???? ??????
game:GetService("UserInputService").InputBegan:connect(rotatechange)

1 answer

Log in to vote
0
Answered by
Vulkarin 581 Moderation Voter
6 years ago

I'd make a Humanoid.Died event that resets your camera back to the defaults

player.Character.Humanoid.Died:Connect(function()
    camera.CameraType = "Custom"
    camera.CameraSubject = player.Character.Humanoid
end)
0
Sorry, but camera position doesn't change when player died. Astrogue 75 — 6y
Ad

Answer this question