A warp effect script

Found this on the forums and it’s just what I’m looking for. Problem is I can’t get it to work like shown. The thread is very old and this wasn’t the main topic …

game:GetService("RunService").RenderStepped:connect(function() 
	if (distort > 0.001) then
		cam.CoordinateFrame=cam.CoordinateFrame*CFrame.new(0,0,0,distort,0,0,0,distort,0,0,0,1)
		distort = distort - 0.001
	end 
end)

I plugged in values that seem logical but nothing happens. This is the effect at a constant call of 179.

3oFzmpg5igRXP7qZPO

Where am I going wrong here and where do I put the script if I can get it working.

I guess I did bump the thread … the one about FOV

2 Likes

I could really use some help with this guys … Surly someone knows this as there are examples of it working. This would be part of a 2 year+ project for me. Any pointers at all would be helpful.

Alright. For one, I don’t recommend using Camera.CoordinateFrame as it is deprecated and not recommended.

Other than that, I don’t know about CFrames too much, but I can help you organize your code a little bit.

First, performing an operator, such as a = a + 1 is unnecessary. You can do a += 1 to add to the same value. This comes in handy to the third line of the code you mentioned.

Anyways, check if (distort > 0.001)'s value to make sure if it is true or false. I always debug like this, but again I’m just giving generic help because I know nothing about CFrames like this.

At least you tried. I understand about the +=1 thing and all. Not really worried about how the script looks atm because I can’t even get it to do anything at all. Not even sure where to put the script at this point or if I’m aimed at the right thing. Nothing seems to happen at all. :unamused:

This is trying to force the FOV past 120 by constantly calling it. That effect comes from that.

I’ve been trying to figure how to warp the FOV past 120 for years! I do know a command in HD admin can do it, but I haven’t bothered to look at the source code for it.

That gif you’re looking at is doing just that. Off this code somehow!
There is just no response from it no matter how you wright it. Maybe it’s more than deprecated …

This comes down to how CFrames are composed

Normally you see CFrames as

CFrame.new(x,y,z)

x,y,z Act as a normal Vector3

But there is actually 9 other parts in the constructor, these are known as the Rotation Matrix

CFrame.new(x,y,z, R00,R01,R02,R10,R11,R12,R20,R21,R22)

The ones that are of importance are R00, R11, and R22. Create a part and run this in the command bar

workspace.Part.CFrame = CFrame.new(0,10,0, 1,0,0,0,1,0,0,0,1)

image

Seems normal, right? Now change R00 (The fourth digit) from 1 to -1

image

It’s Inverted! Despite no differences in the part’s position or orientation, an obvious change has occurred. We’ve essentially flipped the rotation matrix

In the same way, we can apply this to the Camera’s CFrame. By plugging in numbers from 1 going down to 0.001 for R11 and we essentially are slowly “inverting” the camera’s CFrame, which in turn changes how the FOV is perceived. There’s no actual property change, just clever maths

TLDR; Try only numbers from 1 to 0.001 for distort

3 Likes

And to think of all the meshes I inverted in blender to get this effect …:eyes:
I did make some progress … well I figured out how they did part of it anyways.

local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable 

wait(3) print("go")
distort = 0.176
game:GetService("RunService").RenderStepped:connect(function() 
--	if (distort > 0.001) then
		camera.CoordinateFrame=camera.CoordinateFrame*CFrame.new(0,0,0,distort,0,0,0,distort,0,0,0,1)
--		distort = distort - 0.001
--	end 
end)

Camera needs to be scriptable … doh! and He meant 0.176 not 176 for distort.
This is in StarterGui as a Localscript.

Well I got it … it works as is just depends on where the zoom is at. However it isn’t going to help me with the warp effect I was looking for. Back to the drawing board. Just so it isn’t a total waste of time here is a drunk effect … let’s see you do your obeys like this …

local rs = game:GetService("RunService")
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable 
wait(2) print("you've drank way too much punch!")
local BlurFX = Instance.new("BlurEffect")
BlurFX.Name = "Blur"
BlurFX.Parent = workspace.CurrentCamera
BlurFX.Size = 10
distort = 0.3

for count = 1, 25 do rs.Stepped:Wait()
	for count = 1, 25 do rs.RenderStepped:Wait()
		camera.CoordinateFrame=camera.CoordinateFrame*CFrame.new(0,0,0,distort,0,0,0,distort,0,0,0,1)
		distort = distort + 0.0005
	end	
	for count = 1, 25 do rs.RenderStepped:Wait()
        camera.CoordinateFrame=camera.CoordinateFrame*CFrame.new(0,0,0,distort,0,0,0,distort,0,0,0,1)
		distort = distort - 0.0005
	end	
end

camera.CameraType = Enum.CameraType.Custom
BlurFX:Remove()

This script is in StarterGui as a Localscript.