I have a sort of vehicle where the camera is constantly positioned at the seat’s rightVector * 10.
I want to figure out how I can make the camera move smoothy instead of just constantly being right behind it.
I have a sort of vehicle where the camera is constantly positioned at the seat’s rightVector * 10.
I want to figure out how I can make the camera move smoothy instead of just constantly being right behind it.
if you’re using a while true do loop instead of wait(0.01) add game:GetService(“RunService”).RenderStepped:Wait()
use RenderStepped if your code is on client and HeartBeat if it is on server
I already am, this is the code
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local RS = game:GetService("ReplicatedStorage")
local remote = RS:WaitForChild("cameraEvent")
remote.OnClientEvent:Connect(function(seat, on)
if on then
camera.CameraType = Enum.CameraType.Scriptable
game:GetService("RunService"):BindToRenderStep("cameraHoverboard", Enum.RenderPriority.Camera.Value-1, function()
camera.CFrame = (seat.CFrame + seat.CFrame.RightVector * 10) + Vector3.new(0,6,0)
camera.CFrame = CFrame.lookAt(camera.CFrame.Position, player.Character.Head.Position)
end)
end
end)
This doesn’t help me, do you have other tips?
I don’t think you want to CFrame it immediately. You probably want to Lerp it to the new CFrame to smooth it out.
what is the effect you’re getting?
would you mind sending me a video?
His script would hard mount the camera to the vehicle which would twitch with every bump of the movement.
The normal Roblox vehicle camera stays horizontal and has a slight lag (lerped maybe?) making it a smoother movement system.