New Roblox Camera System that broke my script

Hello, so roblox probably added a new system that broke my Follow Head Camera System. https://create.roblox.com/store/asset/15797309054/The-Strongest-Battlegrounds-Camera-Follow-Head

Whenever i enable shift-lock. The Camera in in the middle.


Is there any fixes??

3 Likes

Can you send the script please? Also you claim that it’s “probable” , but in the title you state it as fact. How do you even know this is Roblox?

1 Like

i literally sent the link… what do you mean how do you even know this is roblox what are you on about

1 Like

I think it would be easier if you sent the script here, it’s a hassle to download the whole thing and open it up and find the relevant script causing the problem.

That’s what the instructions state, provide the script.

1 Like
task.wait(1.5)
local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local rootpart,head = char:WaitForChild("HumanoidRootPart"),char:WaitForChild("Head")
game:GetService("RunService"):BindToRenderStep("CameraOffset",Enum.RenderPriority.Camera.Value-1,function()
	if game.Players.LocalPlayer.Character.Humanoid.Health == 0 then
		game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Head
		return
	end
	game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
	game:GetService("TweenService"):Create(hum,TweenInfo.new(0.3),{CameraOffset = (rootpart.CFrame+Vector3.new(0,1.5,0)):pointToObjectSpace(head.CFrame.p)}):Play()
end)

There’s a lot of interesting things going on with this script. One is that it’s waiting 1.5 seconds, but you end up waiting for the humanoid, head etc anyways. I think your problem originates from the fact that you set the the offset so that it’s always centered on the head. This will override the player module, and you’ll get problems.

I also have worked with the camera module, and you should be able to check if the player is in shiftlock using this line:

self.activeCameraController:GetIsMouseLocked() -- returns boolean

I recommend using a BindableFunction, so you can retrieve if the mouse is locked directly from the module, or you can create some value you can read from other scripts, or an attribute on the camera so it’s accessible to everyone. The whole point is to be able to check if the player is shiftlocking, and if they are, stop lerping.

If you want to continue to lerping, no matter what and always have the camera on the head even if they are shiftlocking use this code:

(humanoidRootPart.CFrame + Vector3.new(0, 1.5, 0)):ToObjectSpace(head.CFrame).Position

it’s the position that the CameraOffset should be able always to be on the head.

but the tweening looks better. the instant looks ugly

Yes, you can still tween it, just use that formula to get the position you want to tween it to.

(Although I recommend lerping, it’s less taxxing)

it didnt work anyways

what module can i use tho

1 Like

Can you send me the code? You must not be doing it right.

It’s used in the camera module. I gave you two methods, but I recommend the last one, it’s easier.

1 Like

and where do i find the camera module

1 Like

It’s a default Roblox module that handles the camera, to retrieve it you have to get it in a playtest session, it should be in StarterPlayer.StarterPlayerScripts, copy the PlayerModule and paste it in your game.

1 Like

to elaborate, this appears to happen when there is any camera offset (via humanoid properties)

1 Like

i dont feel like submitting this as a bug as i would need to go through some things and i cant be bothered so if someone can submit “CameraOffset breaks Shift-Lock” or whatever that would be epic

This is most likely not a bug. That’s why Roblox doesn’t let random people submit bugs, because randoms like to assume it’s Roblox’s fault, when it’s usually just faulty scripting.

1 Like

its definitely a bug
occurring in Flood Escape 2 and is currently occurring on a project of mine that doesn’t touch the camera system in anyway so far (other than camera offset lol)

and to note this behavior only started happening very recently so it is highly unlikely all 3 occurrences are related to the user

1 Like

I’m trying Flood Escape 2 right now, not seeing it.

hold on ill get some footage might take a few minutes since i need to not leak anything from said project lol


quickly went into a random place and did it via changing offset manually

1 Like

That’s not a bug… If you change the offset manually, of course you’re going to get that behavior, it’s designed.