Hello! I need help with my CFrame crouching script. I made a simple CFrame for now but I suck at using CFrame and I don’t understand it at all. All I ask is that someone who is willing to help that understands CFrame can make the arms and head go forwards like seen here
thank you!
Code:
if _G.ForceProne or _G.HitProne > 0 then
KeysDown["x"] = true
end
if KeysDown["x"] and not Sprinting and not Proned and not Sitting and not LeaningLeft and not LeaningRight and not Crouched then
Proned = true
TweenC0(Joint, 0.4, Joint.C0, CFrame.new())
TweenC1(Joint, 0.4, Joint.C1, CFrame.new(0, 0, 2.5) * CFrame.Angles(math.rad(90), 0, 0))
elseif not KeysDown["x"] and Proned then
Proned = false
Humanoid.WalkSpeed = 16
TweenC0(Joint, 0.4, Joint.C0, CFrame.new())
TweenC1(Joint, 0.4, Joint.C1, CFrame.new())
end
_G.Proned = Proned
I don’t have time try to work out a solution, But I’ll try to guide you into the right direction, This will be pseudocode and I’ll explain it
--- I'm guessing your doing a tween so
Tween
Tween1: Joint.C0.CFrame = CFrame.new(yourcframe) * CFrame.Angles(math.rad(yourrad))) -- I'm setting Joint.C0 Cframe to a cframe and setting an angle, which I am using radians, Make sure to use a degree to radian calculator, because math.rad() sees the degree as a radian.
Tween2: Do the same thing
-- and play the tween
Note: I’m not sure what the 0.4 Int does. Could you explain it to me?