Put simply, a basic CFrame operation.
Just use a script to return the MAGIC FORMULA to the default:
CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) < This is returns the Camera back to itās default CFrame
local UIS = game:GetService("UserInputService")
local Run = game:GetService("RunService")
local Cam = game.Workspace.Camera
local Squish = 0.5
Run.RenderStepped:Connect(function()
local MAGIC_FORMULA = CFrame.new(0, 0, 0, 1, 0, 0, 0, Squish, 0, 0, 0, 1)
Cam.CFrame = Cam.CFrame * MAGIC_FORMULA
end)
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E then
if Squish == 0.5 then
Squish = 1
else
Squish = 0.5
end
end
end)
This script above lets you toggle a squish effect for the camera by pressing E
what a pro scripter also I have a question does editing The matrix Cframe of a part work? or does editing the cframe matrices of a camera have the matrices only use?
Sorry Iām a bit confused by what you mean
Just in case youāre talking about R20, R21, and R22, those donāt have to be multiplied by the inverse even though itās negative LookVector
A positive R20 turns the camera right and negative to the left
R21 to the right and when itās negative it turns to the left
and R22 when it itās positive moves the closer to the character the closer it is to 0 (pretty much changes FOV) but once it goes negative, it starts flashing and giving your screen a seizure and can kill the character
Even if thatās not what you were talking about, this brought light on the glitchiness of R20, R21, and R22
Like this is literally what happens when I put a negative R20
Gonna update the page to make the info more accurate
I am 99% sure you can modify the matrix of a part but you have to be super accurate with your inputs unlike with camera CFrame where you can seemingly modify each component to their on values even if they violate how itās supposed to work normally
Here is an example of what happens if you donāt put it accurately. It just ends up causing the part to noclip into the backrooms.
Itās very odd tho because itās still there (as shown by the little blue dot; donāt mind the box around itās part of the character)
And you can easily snap it back to reality by putting itās CFrame to something that is valid
Now, there might be some undiscovered or very obscure thing that can occur when you tingle with a partās CFrame like how it can affect the Camera. But rn there donāt seem to be any and probably isnāt any (There might be! Or might not!)
Imo, it is best to not mess around with manipulating the matrix of a partās CFrame as there are much easier ways to change position and rotation like pretty much everything on the new roblox documentation thingimajiggy
Though I hate how it takes so long to scroll through because of the layout so if you prefer (which I prefer too) just use the old developer page
https://developer.roblox.com/en-us/api-reference/datatype/CFrame
I do miss it too
can confirm this happened when testing
so these is basically no use to the Matrix unless its for cameras? okie
also U should do more specil edition tutorials like more on Cframe. like wth is .from axis angle I know cframe magic but HOLY I cant this Cframe black magic u must teach plz
BAHAHAHAHAHAHAHAHAHA BRO ā THANK YOU SO MUCH
Cant wait to make my roblox avatar spawn as pixel
Can you make more tutorials pls???
Specifically on RayCasting
Sorry late reply,
Well Iām not exactly a CFrame expert myself, so canāt exactly say for sure if matrix is useless (probably better in certain scenarios because itās a feature).
If youāre curious tho, I suggest searching up how matrix works or asking a better scripter about it.
Personally all I use for CFrames are:
CFrame.new() ā New CFrame
CFrame.lookAt() ā New CFrame + Makes the object face another part
CFrame.Angles() ā Angles thingy (honestly have no clue how this works besidesthat it uses radians instead of degrees
CFrame.LookVector() ā Gives a Unit Vector in the direction of the CFrame (a bit hard to explain but itās pretty simple and has alot of uses for creating projectiles, making movement.) Also has āUpVectorā and āRightVectorā counterparts
CFrame:Lerp(TargetCFrame, Alpha) ā Basically itās kinda like tweening. So it moves the CFrame towards the TargetCFrame by using Alpha. (Lets say Alpha is 0.5, then the function will return a CFrame that is in middle of the original CFrame and and TargetCFrame)
^^^ Great for slowing down an object when it approaches a certain position / rotation (If you want the formula for lerp (which is pretty basic), just search up: āLerp Formulaā)
and I also use the math formulas given by the developer page
These are usually my most frequently used CFrame stuff, as they are simple but can do so much with it
The other stuff are also super helpful too!
Example: CFrame:ToEulerAnglesYXZ() can convert the rotation value of a CFrame to orientation form, This is incredible for making objects face the direction of a camera or any other object but you donāt want it rotating up and down (Like a ship)
oki!! (even though there might be one already)
will attempt to make it pretty in-depth
best post ive ever seen on the devforum, thank you
how would i make this work with a fully custom camera
erm⦠the humor⦠i love it GDSGASGASSFAG
LOL I love that last cutoff discord message
btw this is very professional and u professionally explain to me how cframe works !!11
(now i can make a very professional thick camera effect game!!)
10/10
Best post iāve ever seen for something, thank you for thisā¦!
same, same
charlimcharlim
Changing R00 with magic formula makes screen entirely black, even if its default 1, when i change it to 1 it still makes screen entirely black
comedy gold right there
this is super cool, iām gonna use this in a game, iām already cooking up a song for it lmao
How can i make a stretched res effect but actually stretching it sideways instead of compressing it vertically?
edit: u can do it by changing the fov part of the magic formula. the op should update that post but like he hasnt been on the devforum in a while so just take my word for it.
why does lag build up gradually when i consistently change R01 and R02 using sin and cos with delta time?