Delta position is messing up my camera positioning

hey, I’m having weird issues with camera manipulation

local camera_CFrame = CFrame.lookAt(
  (humanoidRootPart.CFrame.Position + humanoidRootPart.CFrame.LookVector * 5 + Vector3.new(0, 6, 0)),
  humanoidRootPart.Position
)
        
print("activated")
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
task.wait(0.35)
animationTrack:Play(0.2)
animationTrack:AdjustSpeed(0.65)
event:FireServer()
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = camera_CFrame


(what it’s supposed to look like)

(what it actually looks like)

this snippet of code is used to position my camera towards my character’s hrp when my character jumps, however it doesn’t position it correctly because it’s going to be at the delta position of the hrp

I’m thinking of making a camera part, but I remembered that it won’t position correctly too because it’ll also be at the delta. If anyone could help, I’ll appreciate it :slight_smile:

2 Likes

Swap the arguments, they’re in the wrong order I’m pretty sure

Nope, it’s the at param first, then the lookAt param next

I tried with a 1 second delay, and it works like what it’s supposed to look like

Oh yeah, I mixed up the “what it’s like” and “what it’s supposed to be like” pictures, sorry :sweat_smile:

What do you mean by “delta position”?

Acording to Google, delta position means the last position the part was at before the position was updated

Looks fine to me, but you should probably define the camera’s CFrame after the wait. As the player could move during that wait window.

	print("Activated")
    humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
	task.wait(0.35)
	local CamCFrame = CFrame.lookAt((HumanoidRootPart.CFrame.Position + HumanoidRootPart.CFrame.LookVector * 5 + Vector3.new(0, 6, 0)), HumanoidRootPart.Position)
	
	animationTrack:Play(0.2)
	animationTrack:AdjustSpeed(0.65)
	event:FireServer()
	
	Camera.CameraType = Enum.CameraType.Scriptable
	Camera.CFrame = CamCFrame
1 Like

thank you, this actually worked!

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