Is there any way to keep the camera still during a motion like this?
Current camera script:
local RunService = game:GetService("RunService")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Part = Player.Character:WaitForChild("HumanoidRootPart")
local Camera = workspace.CurrentCamera
local DIST_FROM_PLAYER = 19 -- decrease this to make the camera close and increase for vice versa
local HEIGHT = 5.5--increase or decrease to change the height from the ground
Camera.CameraType = Enum.CameraType.Scriptable
repeat RunService.Stepped:Wait() until Player.Character.Torso
RunService.RenderStepped:Connect(function()
Camera.CFrame = CFrame.new(Character.Torso.CFrame.Position+(-Character.Torso.CFrame.LookVector*DIST_FROM_PLAYER),Part.Position)*CFrame.new(0,HEIGHT,0)
end)
try making a part where you want the camera to be and Weld it to the car and set the parts properties CanCollide off and Massless True then set the camera cframe to the part that way its always above the car EVEN if its upside down
Zero out the x and z rotation, so you only have the y rotation.
RunService.RenderStepped:Connect(function()
local cf = CFrame.new(Character.Torso.CFrame.Position+(-Character.Torso.CFrame.LookVector*DIST_FROM_PLAYER),Part.Position)*CFrame.new(0,HEIGHT,0)
local _, y = cf:ToOrientation()
Camera.CFrame = CFrame.Angles(0, y, 0) + cf.Position
end)
oh, im pretty sure thats because the part rotates with it. try limiting the parts rotation angles that way you still have the effect but it doesnt go upside-down. or just make the part not rotate at all
dude in the RenderStepped function just set the camera cframe to the part like this: cam.CFrame = part.CFrame
im pretty sure it didnt work due to your `
The camera to me doesn’t seem to flip upside, instead it just ends up behind the track. I think the problem here is that you don’t want it behind the track. You can instead make the camera have an offset from the torso by a certain amount.