Trouble with making the character lie down using CFrame

I’m doing a bed script where the player can trigger a prompt and lay down in bed
it works but the thing is not as intended
I’m trying to rotate the player 90 degrees so it looks at the end of the bed which works but then when i try to rotate it 90 degrees to where its laying down it just makes the character go sideways… I even tried using a dif axis to but it didnt work, what am I doing wrong how can I fix this?

This is the code

	HRP.Anchored = true
	HRP.CFrame = Base.CFrame * CFrame.Angles(math.rad(90),0,0) * CFrame.Angles(0,math.rad(-90),0) 
1 Like

Do you mean trying to make the player lay down straight? if yes, then by taking standard cframe when a part is inserted, I would say remove the *CFrame.Angles(0,math.rad(-90),0) and it should work.

Again this really depends on CFrame of the base, so you should just use trial and error to achieve it. I would recommend using animations instead tho, but yeah its really upto you how you wanna do it.

1 Like

Nevermind, I Finally Got It Working, I just had to only change the X and Z Axis

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.