#Camera keeps delaying and sometimes wont pop up.

1 messages · Page 1 of 1 (latest)

dark wedge
#
  if offset.Y > currentSegmentHeight then
    print(offset.Y, currentSegmentHeight)
    return -- Equivalent of continue
  end
  -- Rest of the segment processing code
end

-- Assuming you have a loop
for _, segment in ipairs(segments) do
  processSegment(segment.offset, segment.height)
end
distant crater
pallid rock
dark wedge
#

nooo mb

#

wrong script

#

wtf

dark wedge
#

gimmie a sec

distant crater
#

i thought it was actually an ai generated script

#

cause its well-documented

dark wedge
#
local char = player.CharacterAdded

local defCframe = camera.CFrame

function updateCamera()
    camera.CFrame = game.Workspace.MainCamera.CFrame
end

local frame = script.Parent.Frame
frame.AnchorPoint = Vector2.new(0, 0)
frame.Position = UDim2.new(0.275, 0, 0.616, 0)

game:GetService('RunService').RenderStepped:Connect(updateCamera)

script.Parent.Frame.PLAY.MouseButton1Click:Connect(function()
    frame:TweenPosition(UDim2.new(0.275, 0, 3, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad)
    wait(0)
    frame:Destroy()
    script:Destroy()
end)```
pallid rock
#

I don’t think ai comments like that

distant crater
# dark wedge ```local player = game.Players.LocalPlayer local char = player.CharacterAdded l...
local player = game.Players.LocalPlayer
local char = player.CharacterAdded

local defCframe = camera.CFrame

function updateCamera()
    camera.CFrame = game.Workspace.MainCamera.CFrame
end

local frame = script.Parent.Frame
frame.AnchorPoint = Vector2.new(0, 0)
frame.Position = UDim2.new(0.275, 0, 0.616, 0)

game:GetService('RunService').RenderStepped:Connect(updateCamera)

script.Parent.Frame.PLAY.MouseButton1Click:Connect(function()
    frame:TweenPosition(UDim2.new(0.275, 0, 3, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad)
    wait(0)
    frame:Destroy()
    script:Destroy()
end)
distant crater
#

are u dunce

pallid rock
#

I’ve seen a lot of ai code in here

#

commenting on the return is a little out of character for it

distant crater
#

Ai codes are always well-documented

pallid rock
#

same w the Assuming you have a segment part

distant crater
#

and have some smart brain words

pallid rock
#

I only ever see chatgpt so maybe

distant crater
#

Oh i see

dark wedge
#

hm?

distant crater
#

game:GetService('RunService').RenderStepped:Connect(updateCamera)

#

Your running this as soon as the game starts i assume,

#

Instead, wait for the character to spawn/load in before running that

pallid rock
#

local Character = Player.Character or Player.CharacterAdded:Wait()

#

my beloved line

dark wedge
#

when i load in i can see my character, i shouldnt see it. i should see where the camera is pointing

distant crater
pallid rock
#

yea waiting for the character doesn’t explain it sometimes working

dark wedge
#

oh?

distant crater
#

And also its .RenderStepped

pallid rock
#

it’s spelled right

distant crater
dark wedge
#

so how should i put it?

distant crater
#

Try tweening it in an interval instead

#

What is it supposed to do anyways?

pallid rock
#

while condition do
task.wait(.2)
end
?

distant crater
#

I cant quite understand it

#

😭

dark wedge
#

shall i show you?

pallid rock
#

yes pls

distant crater
#

are u making something like this?

#

where its a camera fixed at a position?

dark wedge
#

eh

#

lemme show

pallid rock
#

not the screen gui

#

hmmmmm

distant crater
#

also can you show the output

#

for any errors or warnings?

dark wedge
#

mainly

#

the camera is supposed to be point this way

distant crater
dark wedge
steep oreBOT
#

studio** You are now Level 3! **studio

dark wedge
#

but

distant crater
#

Oh i see

#

i see

#

so it is that

pallid rock
#

camera type

dark wedge
distant crater
#

yeah now i know your problem

#

you never set the CameraType or something like that

#

let me check

pallid rock
#

i’m assuming he’s setting the camera cframe as part of the title screen

#

cameratype can be scriptable until the play button is hit

dark wedge
#

but look

#

ima show something so crazy

#

did it on a baseplate

#

it works completely fine

#

but on my other game it says otherwise

distant crater
# dark wedge
local player = game.Players.LocalPlayer
local char = player.CharacterAdded
local camera = workspace.Camera

local defCframe = camera.CFrame

function updateCamera()
    camera.CFrame = game.Workspace.MainCamera.CFrame
end

camera.CameraType = Enum.CameraType.Scriptable

local frame = script.Parent.Frame
frame.AnchorPoint = Vector2.new(0, 0)
frame.Position = UDim2.new(0.275, 0, 0.616, 0)

game:GetService('RunService').RenderStepped:Connect(updateCamera) -- i guess this could work?


script.Parent.Frame.PLAY.MouseButton1Click:Connect(function()
    frame:TweenPosition(UDim2.new(0.275, 0, 3, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad)
    camera.CameraType = Enum.CameraType.Custom
    wait(0)
    frame:Destroy()
    script:Destroy()
end)

try this for a second

dark wedge
#

it works but

#

im stuck on this now

distant crater
#

oh wait

#

mb

#

hold on

pallid rock
#

oh he ran into that issue exactly lmao

#

you declared m = true but never used it in that code

distant crater
pallid rock
#

LOL

#

it’s ok man

distant crater
#

i was gonna use

#
while m do
...
end
#

😭

pallid rock
#

a while loop isn’t necessary bc runservice is fine with changing the camera locally

distant crater
#

i figured

dark wedge
pallid rock
pallid rock
pallid rock
dark wedge
#

first time it was good but just stuck on the intro model

#

but now its same issue

distant crater
# dark wedge
local gui = script.Parent
local frame = gui:WaitForChild("Frame")
local playButton = frame:WaitForChild("PLAY")
local mainCameraPart = workspace:WaitForChild("MainCamera")

local DCT = Enum.CameraType.Custom
local connection

camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = mainCameraPart.CFrame

connection = RunService.RenderStepped:Connect(function()
    camera.CFrame = mainCameraPart.CFrame
end)

frame.AnchorPoint = Vector2.new(0, 0)
frame.Position = UDim2.new(0.275, 0, 0.616, 0)

playButton.MouseButton1Click:Connect(function()
    frame:TweenPosition(UDim2.new(0.275, 0, 3, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.5, true)
    
    task.delay(0.6, function()
        if connection then connection:Disconnect() end
        camera.CameraType = DCT
        gui:Destroy()
    end)
end)

try this

dark wedge
#

okay

#

same issue 💔

distant crater
#

ggs

#

✌️

dark wedge
#

and the playbutton doesnt work

#

💔

distant crater
#

welp

#

i dont know how else to help you

#

probably another script interfering with it

#

so

#

ggs

#

✌️

dark wedge
#

uh

#

hold on

#

would it be the GUI menu?

#

because the menu is basically buttons

#

local object = script.Parent
object.Position = UDim2.new({-{-0.354, 0},{-4.767, 0}
    object.AnchorPoint = Vector2.new({-0.354, 0},{-4.767, 0})
    object.Size = UDim2.new({1.421, 0},{2.251, 0}

    local newColor = Color3.fromRGB(255, 0, 0)
    local oldColor = Color3.fromRGB(255, 255, 255)

    local tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
    local Tween = TweenService:Create(object, tweenInfo, {ImageColor3 = newColor})
    local Tween2 = TweenService:Create(object, tweenInfo, {ImageColor3 = oldColor})

    object.MouseEnter:Connect(function()
        script.Parent:TweenPosition(UDim2.new(0.451, 0,-0.225, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .25, true)
        script.Parent:TweenSize(UDim2.new(0.572, 0, 1.209, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .25, true)
        Tween:Play()
    end)

    object.MouseLeave:Connect(function()
        script.Parent:TweenPosition(UDim2.new(0.468, 0, -0.14, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .25, true)
        script.Parent:TweenSize(UDim2.new(0.53, 0, 1.024, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .25, true)
        Tween2:Play()
    end)``` which is the title
#

local object = script.Parent
object.Position = UDim2.new(-{0.224, 0},{0.657, 0})
object.AnchorPoint = Vector2.new(0, 0)
object.Size = UDim2.new(0.507, 0,0.871, 0)

local newColor = Color3.fromRGB(255, 0, 0)
local oldColor = Color3.fromRGB(255, 255, 255)

local tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local Tween = TweenService:Create(object, tweenInfo, {ImageColor3 = newColor})
local Tween2 = TweenService:Create(object, tweenInfo, {ImageColor3 = oldColor})

object.MouseEnter:Connect(function()
    script.Parent:TweenPosition(UDim2.new(-0.081, 0,-0.061, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .25, true)
    script.Parent:TweenSize(UDim2.new(0.55, 0, 0.988, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .25, true)
    Tween:Play()
end)

object.MouseLeave:Connect(function()
    script.Parent:TweenPosition(UDim2.new(-0.057, 0, -0.003, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .25, true)
    script.Parent:TweenSize(UDim2.new(0.507, 0,0.871, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .25, true)
    Tween2:Play()
end)```which is the play button
dark wedge
#

and it works but

#

hold on ima send u what it looks like

#

weird to have the black screen first tho

#

ill test it in actual game

#

black screen

distant crater
#

but eh,,,

#

goodluck

#

i wont help any further cause im kindof

#

sleepy

dark wedge
#

okay

#

well uh

dark wedge
#

its just the camera keeps going somewhere else then spawns on the intro

#

weird but its fine

#

ill find out someway

#

thank you btw

#

i appreciate it

steep oreBOT
#

studio** You are now Level 4! **studio