#Any ideas of how to make a Locked Smooth Camera follow Vehicle?
1 messages · Page 1 of 1 (latest)
Set the camera mode to follow
I want the camera to be almost "locked" to a part, as we would set camera.CFrame = cameraPart.CFrame, because follow makes you be able to rotate the camera with the right click of the mouse, and the camera is too far away from the car.
some vehicles will have different cameras positions
Oh boy do I have the solution for you
Hello and welcome to the official channel of Zero Man you can expect to see the following please make sure to subscribe if you want to see more videos in the future
- Weekly uploads
- Community engagement(Monthly)
- Friendly Advice
- Gaming
- Music(own songs)
Music for videos provided by|
(NCS): https://www.youtu...
I saw a video that a guy has made with the camera set to scriptable and he used the spring module, he made the tutorial and did not showed the functions that return certains values to it
Thats the vid
he did not showed the functions
ok
I'm using it in a project rn
Very simple to use
And very good
game.RunService.PreRender:Connect(function(delta)
Spring.target(camera, 1, 3, {CFrame = car:GetPivot() * CFrame.new(0, 0, 10)})
end)
Make sure to set the camera to Scriptable
Almost works, still the same result 🙁
Did you use PreRender?
Yes, I used the RunService.PreRender
Not sure what's wrong then
When it goes at high speed the camera starts "glitching"
I dont know if its because the camera is trying to reach the point and then the car deslocates its point to another, because its moving
I dont know if there would be a way that might exist a "artificial" lerp that has a "range" and stops it from happening
but I still want it to look smooth, the only problem would be to find the returned values form the functions in that video
might be the solution but the "getClosestAngles" is the one who I have no idea what it would return
the rest of it I kinda have an idea of how it might work
getPositionAndAnglesFromCFrame() might be something returning like: goal.Position, goal.Rotation
the getCFrameFromPositionAndAngles is probably something like return CFrame.new(position) * CFrame.Angles(angles)
Oh, I used the AlignPosition and Orientation and it worked so smoothly
Yes, I was playing with it. This is how the code looks like now:
local Attachment = Instance.new("Attachment", CameraPart)
local AlignPosition = Instance.new("AlignPosition", CameraPart)
AlignPosition.MaxForce = 1000
AlignPosition.MaxVelocity = 0
AlignPosition.Attachment0 = Attachment
AlignPosition.Attachment1 = ReferenceA
AlignPosition.Mode = Enum.PositionAlignmentMode.TwoAttachment
AlignPosition.ForceLimitMode = Enum.ForceLimitMode.PerAxis
AlignPosition.ForceRelativeTo = Enum.ActuatorRelativeTo.Attachment0
AlignPosition.Responsiveness = 25
local AlignOrientation = Instance.new("AlignOrientation", CameraPart)
AlignOrientation.MaxTorque = 1000
AlignOrientation.Responsiveness = 15
AlignOrientation.Attachment0 = Attachment
AlignOrientation.Attachment1 = ReferenceA
AlignOrientation.CFrame = CameraReference.CFrame.Rotation
--/ Variables
local LatestDeltaTime = 0
--/ Render
RunService:UnbindFromRenderStep("Camera")
local cameraOffset = CFrame.new(0, 2.5, 20)
local Connection = RunService.RenderStepped:Connect(function()
GetCameraType(Enum.CameraType.Scriptable)
-- CameraPhysics.target(Camera, 1, 3, {CFrame = Chassis:GetPivot() * cameraOffset})
Camera.CFrame = CameraPart.CFrame
end)``` in the case you want to know too