-
What do you want to achieve? Keep it simple and clear!
I’d like to make it so that whenever I get into a vehicle seat, and start moving the vehicle, the camera doesn’t auto rotate towards the center. -
What is the issue? Include screenshots / videos if possible!
The issue is, the camera is positioning itself towards the center whenever I try to move the camera, in first person and third person, away from the center. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
So far, I’ve tried making it so that shift lock is enabled when the player sits in the seat, I’ve tried changing the camera subject to the humanoid of the player sitting in the seat, and I’ve tried setting the camera to a part. I’m not sure if I had tried these solutions incorrectly as I don’t have the code for these solutions anymore since I had scrapped it not too long after finding most of them didn’t work. I’ve been getting really desperate for a solution to this problem. I’ve seen previous posts on the dev forum about this being a bug, and it later being fixed. I still have this issue however. Hopefully I’m just missing a small piece to this puzzle and it will be quick to solve.
Are you setting the CameraType
to Scriptable
?
Yep, everything I’ve tried I’ve made sure to set the camera to scriptable.
Try setting the camera type to Track instead… and make sure to set the camera subject. It wont rotate automatically.
I made this local script which is supposed to constantly make the Cameratype scriptable and set the subject to humanoid, (which I found solves the problem but has to be done manually by changing the camera subject in the element in the explorer when in game.) However, this doesn’t change the camera subject when the player is in the DriveSeat. When the game starts though, the subject is the player’s humanoid, but is overridden when the player gets in the vehicle seat.
local camera = game.Workspace.CurrentCamera
while true do
wait(0.1)
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = game:GetService("Players").LocalPlayer.Character.Humanoid
end
I’m sure there’s a better way to complete this but for now I’m looking for a solution before I optimize.
Check out this post’s solution, it should work for you:
This works! Thank you so much!!