#head movement doesn't worky anymore?

1 messages · Page 1 of 1 (latest)

sleek grotto
#

i swear it was working just fine literal seconds before finishing the cams, could you please help?

#

and here is the camera panel script

local CameraPanel = script.Parent
local OfficeUI = game.Players.LocalPlayer.PlayerGui:WaitForChild("OfficeUI")
local CamParts = workspace:WaitForChild("CamParts")
local Camera = workspace.CurrentCamera

CameraPanel.Changed:Connect(function()
    if CameraPanel.Enabled == true then
        Camera.CFrame = CamParts:WaitForChild("Cam1").CFrame
        Camera.FieldOfView = 70
    end
end)

CameraPanel.Cam1Button.MouseButton1Click:Connect(function()
    Camera.CFrame = CamParts:WaitForChild("Cam1").CFrame
end)

CameraPanel.Cam2Button.MouseButton1Click:Connect(function()
    Camera.CFrame = CamParts:WaitForChild("Cam2").CFrame
end)

CameraPanel.Cam3Button.MouseButton1Click:Connect(function()
    Camera.CFrame = CamParts:WaitForChild("Cam3").CFrame
end)

CameraPanel.CamsOFF.MouseEnter:Connect(function()
    CameraPanel.Enabled = false
    OfficeUI.Enabled = true
    Camera.CFrame = CamParts:WaitForChild("OfficePOV").CFrame
    Camera.FieldOfView = 90
end)
#

didn't use pastebin for the second because its short

#

kinda

sleek grotto
#

bump

sleek grotto
#

okay vro its been hours

#

someone answer 🥀

proven wren
sleek grotto
#

didn't i use the inside chat in the video?

#

also yeah worky is just a typo

proven wren
sleek grotto
#

...alr

#

Simply i cannot use the head movement system anymore, which was working just fine before i worked on the cameras

#

im assuming this is some kind of UI thing

proven wren
sleek grotto
#

well

#

the only thing that can possibly be related is the on/off switch that i put to switch between the 2 uis

proven wren
#

i mean just going by that one sentence we already know you changed something about the cameras which broke it

#

i'm guessing you refactored it and left something out, or your logic is wrong

sleek grotto
#

pretty sure i did also check that the office UI is actually enabled

#

and uhh it is

#

wait

#

could it be this part?

CameraPanel.Changed:Connect(function()
    if CameraPanel.Enabled == true then
        Camera.CFrame = CamParts:WaitForChild("Cam1").CFrame
        Camera.FieldOfView = 70
    end
end)```
sleek grotto
#

nope

#

same thing

#

i also tried disabling cams and deleting the script entirely but nothing

#

so mabye it has to do with the main control itself

proven wren
sleek grotto
#

everything under this comment

--OFFICE CAMERA CONTROLS--

proven wren
#

bro

#

use your words

#

wat is it, and did you write it

sleek grotto
#

its what allows the player to look left and right, needed to actually see doors

#

since you know

#

fnaf

#

and uhh it uses 2 text buttons and their .MouseEnter events

#

it also works with arrow keys

#

well, worked

proven wren
#

so it's a fnaf clone

sleek grotto
#

type shit

#

yes

proven wren
#

did you write this script

sleek grotto
#

yea

proven wren
#

what debug steps have you taken already on this script

sleek grotto
#

deleting camera script, thats just it

#

actually

#

let me try redoing the office UI

#

same thing

sleek grotto
#

checked also if the cam is deattached or something

#

player cam i meant

#

and uhh

#

yeah nothing either

proven wren
#

is the script even running

sleek grotto
#

well yeah

#

wait actually

#

yeah it actually is runnin

#

its really just something in the script that doesn't trigger

#

okay i just checked if the limit works

#

and yeah it does

#

so that means that the inputs DO work

#

they don't do shit

#

which means the damn tweens don't work

#

okay how about this

#

i'll just add a check for wether the office UI is on or not

proven wren
sleek grotto
#

yeaah kinda

#

its just the tweens that are doing this

proven wren
#

congrats, you have learned the art and skill of debugging

sleek grotto
#

aaaand even with the check it doesn't do shit

#

actually it now only works WHILE the cams are on

#

which is the opposite

#

of the check

#

by the way

#

i noticed this in the output

#

could this have anything to do with the script

#

or is it a roblox issue

proven wren
sleek grotto
#

so its a roblox thing?

proven wren
#

it's probably one of your scripts

#

also server does not have a localplayer

sleek grotto
#

it redirects to this "operator" module or something

#

so i don't think thats it

#

yeah im out of ideas

sleek grotto
proven wren
#

more prints, check stuff during runtime

#

reduce the problem

#

etc

sleek grotto
#

"reduce the problem"'

#

?

#

wdym by that

zealous zinc
# sleek grotto "reduce the problem"'

I think he's telling you to add more prints and see what the output says. If you're expecting the code to f.ex. local Tweening = true, then print(Tweening) and see if it is true. If it's false, then you find a solution and reduce the problem

sleek grotto
#

i would still need some kind of .IsPlaying property for the tweening for that to work, because otherwise it just prints a independant bool value

#

and that property doesn't exist

zealous zinc
#

Sorry, I just took "Tweening = true" as an example.

I haven't really read your script, because reading on my phone makes me nauseous with how the lines get split up.

#

Point is: add printing.

  1. What do u want to do

  2. How should the system work

  3. How does the system ACTUALLY work

  4. Fix system.

sleek grotto
#

okay i did something

#

uhh i did fix the part where the head would still be moveable while using cams

#

however both types of inputs only work AFTER using cameras

#

so you ahve to open and close cameras again to use them

#

which i guess its an improvement

#

but the tweening is still broken

#

so uhh

#

yeah

proven wren
# sleek grotto "reduce the problem"'

reducing the problem means reducing the number of moving parts in a construction to it's Minimum Reproducible Example https://en.wikipedia.org/wiki/Minimal_reproducible_example

In computing, a minimal reproducible example (abbreviated MRE) is a collection of source code and other data files that allow a bug or problem to be demonstrated and reproduced. The important feature of a minimal reproducible example is that it is as small and as simple as possible, such that it is just sufficient to demonstrate the problem, but...

proven wren
#

if that doesn't work then you know there is something about your construction that isn't built to take the tween how you thought it did

proven wren
#

you must always prove what the code is doing

#

like i've seen so many help threads that are like "this doesn't work in my script but the script is working" -- it cannot be both

#

if it turns out code you assumed was correct, without checking it, was actually the cause, it is not possible to solve it without first figuring out your assumption was wrong - how do you do that? - again, prove everything. don't be like "oh i think it works" and call it done.

#

tl;dr prove it works, don't just think or assume it.

sleek grotto
#

soo i should make a smaller replica of the whole cam movemet setup

proven wren
#

another way is process of elimination, try alt methods, more prints to see what is and is not executing

proven wren
# proven wren i.e for example if you're sure it's purely the tween, set up your test scenario ...

just as a practical example here, say for example you have 2 pieces of code that are interacting with the camera, one is your tween, another sets the camera's cframe every frame, and you assume only one of them is running. when you tween it manually and see nothing, you can immediately assert that there is code interfering with what you're doing and, for example, delete the camera and see what happens (i.e errors might be thrown)

#

this is debugging, it is a slow and tedious process of eliminating potential causes, proving things are or are not running and/or behaving correctly, and testing runtime behavior.

#

the only reason high level scripters can come in and appear to do this so easily is because they've been doing it for so long that they know enough shortcuts, and often know what to look for

proven wren
#

inferences are powerful, but it all still relies on proof and evidence.

sleek grotto
#

okay, about that example

#

i did try out using commands to do the tweening, and yeah the tween does not, infact, work

#

so there is indeed a part that interfers with the tween

#

which can only have to do with the OfficePOV part

#

i think

proven wren
sleek grotto
#

redo the command?

proven wren
#

do also again consider reduction: Remove your entire project as a possible cause by taking your test code and running it in a completely blank baseplate with the minimum necessary to test your code

#

like if you're just tweening the camera it's a blank baseplate with nothing else, just tween(camera):play

#

just to prove your command is in fact working

#

because yes you have to prove that too

#

prove the command you're running does what it should do under normal circumstances

sleek grotto
#

normal circumstances being "blank baseplate"?

proven wren
#

normal circumstances is 100% roblox official standard

#

blank baseplate, or close to

#

the roblox templates often count towards this as well

sleek grotto
#

okay, disabled main control script, tween NOW works

proven wren
#

while at the same time proving that it server authority does in fact work, it just doesn't work for humanoids

#

i actually found another related bug to this, if you scale down the humanoid there are more mispredictions

#

so ya humanoids is a janky bodge job at predicting characters. but i digress

proven wren
sleek grotto
#

actually no its the same file

proven wren
#

or did you just disable your control code?

sleek grotto
#

yeah

#

that

proven wren
sleek grotto
#

should i then just rebuild from zero, and then check step by step?

proven wren
#

e.g when people complain about .touched, their technique is wrong, not roblox.

proven wren
#

sometimes you can disable/enable parts of your code at once to narrow it down, kind of like disable all mods then enable one at a time until you find the culprit

#

depends how you wrote your code tho

#

e.g find all for workspace.CurrentCamera is a good place to start

#

or just the word Camera

sleek grotto
#

okay im trying to do an MRE rn

#

basically just remaking from zero

#

so far so good

proven wren
proven wren
#

those were once-off tests

sleek grotto
#

im gonna try adding the arrow key inputs now

proven wren
#

i actually wrote entirely custom input controls just to prove it wasn't roblox's playermodule

#

that took me a while

sleek grotto
#

yeah the tween is still working at this point

#

brb rq

sleek grotto
#

OKAY

#

I MIGHT HAVE FIXED

#

just let me run one more test really quickly and i can end this

sleek grotto
#

IT ACTUALLY WORKS!!!

#

Thx man

#

and also merry xmas

proven wren
# sleek grotto IT WORKED!!!

give someone a fish, feed for a day. teach how to fish, feed for a lifetime. this is the art and skill of debugging. you're welcome, merry christmas 🎄