Hey, so im doing some testing with a camera system for xbox and I found this weird bug with studio, but before I report this bug I need to know if its even my fault.
Let me write a detail list of what I did to recreate this and what it does.
First: I open a empty place click play and everything is normal, normal baseplate empty game.
Second: I insert this script in starter player scripts
local RS = game:GetService("RunService")
local plr = game.Players.LocalPlayer;
local char = plr.Character or plr.CharacterAdded:Wait();
local Camera = workspace.CurrentCamera;
--//State
local Offset = Vector3.new(0, 25, 0);
local function Update()
if (char) then
local HumPart = char:FindFirstChild("HumanoidRootPart");
if (HumPart) then
Camera.CFrame = CFrame.new(HumPart.CFrame.Position + Offset) * CFrame.Angles(-math.rad(90), 0, 0);
end
end
end
RS:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, Update)
This script works but after walking for a second all inputs suddenly don’t even work besides jumping, (WASD = Broke).
I disable this script and when I click play camera is broke -__-
Do note there is no script in this game besides the script I just made above, even though the script is disabled it broke the camera? | I also tried this in 2 different places and the same issue happened. Is this a fault in my script or engine bug?
So turns out that this was not an issue with my script instead the name of script being ‘CameraScript’ in StarterPlayerScripts does this. I don’t know if this is intentional or not, so if someone can give me a explanation on why it does this then thanks >.>
It overwrites the CameraScript inserted by the backend. The forking behaviour has been discussed on both the forums and the Developer Hub; making a script with the same name as a StarterPlayerScript prevents it from being added.
I probably should’ve noticed earlier that the issue was happening because you inserted a script named CameraScript. I was hesitant because I didn’t find PlayerModule, so I too got confused about why this was happening. That’s when I remembered the difference between the old and new PlayerScripts structure, as well as the forking behaviour around them.
I do remember that including ControlScript and CameraScript tells the backend to use the legacy scripts over the new ones, since developer scripts are prioritised in this regard. By inserting a script named CameraScript, it tells the backend to use the old structure and thus ControlScript also gets added.
Renaming it something different will fix both your issue and insert the new PlayerScripts structure. So you actually get two benefits instead of one.