#head movement doesn't worky anymore?
1 messages · Page 1 of 1 (latest)
here is the main office controls script (actual cam movement)
https://pastebin.com/Mt1jR352
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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
bump
can't just throw code with a 2 minute long recording and go WhY nO wOrKy??
What's no worky, dude? Use your words
.
i'm not watching 2 minutes of something you could describe in one sentence
...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
have you considered maybe this is related?
well
the only thing that can possibly be related is the on/off switch that i put to switch between the 2 uis
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
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)```
is it?
try it and see
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
what is 'head movement system'
everything under this comment
--OFFICE CAMERA CONTROLS--
no
bro
use your words
wat is it, and did you write it
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
so it's a fnaf clone
did you write this script
yea
what debug steps have you taken already on this script
deleting camera script, thats just it
actually
let me try redoing the office UI
same thing
its almost like the office controls script is just dead gone
checked also if the cam is deattached or something
player cam i meant
and uhh
yeah nothing either
is the script even running
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
sounds like you managed to trigger the head movement script to work
congrats, you have learned the art and skill of debugging
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
yep always fix the first error not the last. that's day one 
so its a roblox thing?
not one i've seen
it's probably one of your scripts
also server does not have a localplayer
it redirects to this "operator" module or something
so i don't think thats it
yeah im out of ideas
any ideas?
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
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
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.
-
What do u want to do
-
How should the system work
-
How does the system ACTUALLY work
-
Fix system.
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
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...
i.e for example if you're sure it's purely the tween, set up your test scenario in run mode, then manually execute a tween from the console / command bar
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
it's all about the fact that you cannot rely on guessing
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.
soo i should make a smaller replica of the whole cam movemet setup
that's one way
another way is process of elimination, try alt methods, more prints to see what is and is not executing
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
e.g this is a shortcut on figuring out if any other code is interfering with the camera, and then pinpointing where its coming from
inferences are powerful, but it all still relies on proof and evidence.
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
so disable that code and try again
redo the command?
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
normal circumstances being "blank baseplate"?
yes
normal circumstances is 100% roblox official standard
blank baseplate, or close to
the roblox templates often count towards this as well
it's how I know for a fact that this misprediction is roblox's fuckup and not mine
okay, disabled main control script, tween NOW works
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
i take it you checked it in a blank baseplate
actually no its the same file
or did you just disable your control code?
ya fair same line of thinking, you'd escalate that until the point of blank baseplate, if it still doesn't work your technique is wrong, or roblox is wrong. usually your technique is wrong but ever so occasionally it is roblox that is wrong
should i then just rebuild from zero, and then check step by step?
e.g when people complain about .touched, their technique is wrong, not roblox.
at this point you should have some idea that something in your code base is affecting the camera. search for it.
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
ah yes, much time spent setting up once-off test/proofs. if you want to be a scripter you'll have to get used to this
case in point
those were once-off tests
im gonna try adding the arrow key inputs now
i actually wrote entirely custom input controls just to prove it wasn't roblox's playermodule
that took me a while
OKAY
I MIGHT HAVE FIXED
just let me run one more test really quickly and i can end this
IT WORKED!!!
IT ACTUALLY WORKS!!!
Thx man
and also merry xmas
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 🎄