Camera Delay Effect

So I’m trying to achieve a camera delay effect similar to what you can see in the game Advanced Euphoria Ragdoll, as you can see here:

From what I can tell in the video, the camera offset seems to be constantly changing relative to the players velocity. I thought i could achieve this effect pretty simply by just doing that:

	local camera = workspace.CurrentCamera
	local humanoid = Character.Humanoid		
	while ragdolled do
		humanoid.CameraOffset = -(Character.HumanoidRootPart.AssemblyLinearVelocity)/10
		task.wait()
	end

and this almost works:

It’s just, as you can see, the camera seems to be orbiting around the character, because the humanoidrootpart is rotating. This is due to how the ragdoll system I’m using works, where the humanoidrootpart is rotated along with the character. So I just need a workaround, possibly some way to account for velocity of the humanoidrootpart, just ignoring the orientation of it.

2 Likes

Trying multiplying the velocity by the inverse of the parts rotation (humanoidRootPart.CFrame.Rotation:Inverse()).

1 Like

velocity is a vector3 and the inverse of the rotation is a cframe, so you get an error when you try multiplying them

you could update the camera every frame and instead of moving it up/down relative to the humanoidRootPart, you can move it up/down relative to the global axis. Try using ToObjectSpace() and ToWorldSpace() to convert between global and local axis

how exactly would I write this? I’m not super familiar with vector3 methods

Give this a try. I just convert the offset so instead of being relative to the world, it is relative to the HumanoidRootPart

local camera = workspace.CurrentCamera
local humanoid = Character.Humanoid		
while ragdolled do
	local offset = -(Character.HumanoidRootPart.AssemblyLinearVelocity)/10
	local offsetRelativeToHRP = Character.HumanoidRootPart.CFrame.Rotation:ToObjectSpace(CFrame.new(offset))
	humanoid.CameraOffset = offsetRelativeToHRP.Position
	game:GetService("RunService").Heartbeat:Wait()
end
1 Like

Yeah, that doesn’t seem to work

trying increasing the 10 to 100 or something. Ill take a look at my own script if i did anything wrong

That doesnt change much, to me it looks like its working its just that the camera is being offset to some faroff vector

Nvm, it works, I just had some other scripts which were messing with the camera

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