Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

2d game script not working and no errors? (HELP ME PLEASEEEEEEEE)

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera

player.CharacterAdded:Wait()
player.Character:WaitForChild("Head")

camera.CameraSubject = player.Character.Head
camera.CameraType = Enum.CameraType.Attach
camera.FieldOfView = 100

while wait(0.000000001) do
	camera.CFrame = CFrame.new(player.Character.Head.Position) * CFrame.new(0,0,10)
	end

this script doesnt work and I did everything i can to try to see what was excatly wrong with the script

help mane ;( (also got the cframe part from a youtuber soooo yeah)

5 comments

0

First of all, What are you trying to do?

0

2d platformer

0

What is going wrong? You need more information.

0

test it out yourself, its buggy

0

i wake up the next morning and i test my script and it works LOL

2 answers

✓ Accepted answer

Do not use while wait() do.

use

local r = game:GetService('RunService')

r.RenderStepped:Connect(function() -- code end)

-- it's basically run the code every frame.

This discussion is preserved as it was. New answers, comments, and votes are closed.