Camera Tweening

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want the transition back to the players camera to be WAYYYY smoother than it is now.
    EX. Watch C__Users_conno_Downloads_movement_commission.rbxl - Roblox Studio 2024-04-27 21-40-00 | Streamable
  2. What is the issue? Include screenshots / videos if possible!
    When the player leaves the ledge with spacebar the camera SNAPS right back to the original view. I either want to smooth it down OR make it so the view stays where it was cframed to.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried to lower the lerp position to .05 but it does not affect the camera going outwards.
    --This is what handles the cameras position and how smooth it is coming in

cameraPosBeforeLedge = camera.CFrame:ToObjectSpace(rootPart.CFrame)
    cameraDistance = (camera.CFrame.Position - rootPart.Position).Magnitude
    camera.CameraType = Enum.CameraType.Scriptable
    
    RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, function()
        local cframe = rootPart.CFrame * CFrame.new(0, 10, 15) --Where the camera is placed

        camera.CFrame = camera.CFrame:Lerp(CFrame.new(cframe.Position, rootPart.Position), .1) --Smoothness of camera
    end)

Bumping this post still no solution

Your video no longer exists, but I’ll assume that what you are thinking is that camera tweening looks too “robotic”. To fix this you can try adding some steps before the camera stops and starts where it is moving slower, or you can try using the inbuilt animator and just animate the camera moving, then apply some easing styles. (Usually InOut is the best for smooth movements).

1 Like

This isn’t really able to be applied to this

The video has been fixed sorry about that

I see the video now, but you can use my second suggestion for this. It will be a little bit harder since you need to know the basics on animating inside of ROBLOX but it still should be easy enough, as all it is is playing the animation of the camera moving in or out whenever the situation arises. It also looks like you arent tweening your camera, but using :Lerp. You might want to look into learning how to tween objects.