[help!] Camera Bug when I put CameraOffSet

Hi, I have this script [1] that move the humaindRootPart together the camera movement (into a renderstepped), but when put this script [2] (CameraOffSet) (out of renderstepped) the Character is moved rare like I show in this video:

[1]

				local CameraLook = CurrentCam.CFrame.LookVector;
				local Direction = CFrame.lookAt( HumanoidRootPart.Position, 
					HumanoidRootPart.Position + Vector3.new(CameraLook.X, 0, CameraLook.Z) )
				HumanoidRootPart.CFrame = Direction

[2]

Humanoid.CameraOffset = Vector3.new(2, 2, 3	);

[Video]
https://gyazo.com/f305e1272ef2f1dd312f76bb1c611234
1 Like

I believe I have a solution to this problem:

local char = script.Parent;

local HumanoidRootPart = char:WaitForChild("HumanoidRootPart");

local Humanoid = char:WaitForChild("Humanoid");

local RunService = game:GetService("RunService");

local CurrentCam = workspace.CurrentCamera;

Humanoid.CameraOffset = Vector3.new(2, 2, 3);
Humanoid.AutoRotate = false;

local XY = Vector3.new(1, 0, 1);

RunService:BindToRenderStep("OTSCam", Enum.RenderPriority.Character.Value, function(dt)
	local Position = HumanoidRootPart.CFrame.Position;
	local CameraLook = CurrentCam.CFrame.LookVector;
	local Direction = CFrame.lookAt(Position, Position + (CameraLook * XY));
	HumanoidRootPart.CFrame = HumanoidRootPart.CFrame:Lerp(Direction, dt * 10);
end)

This will allow the player to rotate more smoothly.

Is near that I need it, but I really need that the camera moved like the game showed in this video:

https://gyazo.com/d2df89d54f12d3bc0cbfcfe0a2f39495

Please I’ll apreciate your help!!

You can increase the dt * 10 to dt * 20 or higher to get a faster camera effect.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.