How to make a dizzy effect?

I want to create a dizzy effect (Like strange walking, Camera movements, color saturation e.g.)

I do not know how to trigger it (When you drink a potion, non-alchohol)

Ive looked everywhere but i cant find a solution on how to trigger it.

Any help would be great :smile:

2 Likes

Changing the camera’s CFrame with CFrame:FromMatrix() can warp your perspective if you do it wrong enough. Since you set it through look / up / right vectors, if the combined total has a magnitude over 1 the screen will warp, you can tween this to create a nausea like effect.

2 Likes

I’ve never really scripted with cameras, Would you care to tell me how I do this, Thanks :grinning:

1 Like

Sure, let me show you an example:

						camera.CFrame = CFrame.fromMatrix(
							cameraPosition,
							UpVector,
							RightVector
						)

Assuming the direction for the up and right vectors has a magnitude of 1 by converting the desired direction to a unit vector, it should look normal, like this:


Now lets say the vectors are messed up on a given axis, lets make them slightly shorter than theyre supposed to be, now the game will try to fit more things on the screen as it runs the same distance, but with more and shorter steps, compressing the image, like this:

Going above 1 just breaks the camera.
Since camera scripts are generally bound to the renderstepped event, you could change the vectors in increments of 0.01 or more.

4 Likes

What would the entire script look like?

1 Like

Since it probably triggers on command a remoteEvent should be used:

local camera = workspace.CurrentCamera
local REvent = RemoteEvent
REvent.OnClientEvent:Connect(function()
for i = 1 , 2500 do
camera.CFrame = CFrame.fromMatrix(
	camera.CFrame.Position,
	camera.CFrame.UpVector -Vector3.new(0.01,0.01,0.01),
	camera.CFrame.RightVector -Vector3.new(0.01,0.01,0.01),
)
wait()
end
end)

It would be something like this.

1 Like

Ah, Thank you. I appreciate it. (I’m not very good at scripting.)

4 Likes