CFrame help for FPS game

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
image
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
5 Likes

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?

1 Like

I honestly don’t know. I just found a really simple tut that showed me how to make a smooth tween cframe to make you stand up than fall down.

1 Like

Ok then, Can I see your whole code? And for explanation of CFrame’s, Look at this thread.

2 Likes