Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make the bottom side of the player face a position?

So I'm making the player face the planet that they are on, but I think the facing part is too literal because they are flat down on their face on the ground. How can I make a different side of them face the ground? The bottom side more specifically.

player.HumanoidRootPart.CFrame = CFrame.new(player.HumanoidRootPart.Position, planet.Position);

4 comments

0

player.Character.HumanoidRootPart.CFrame.y

0

Can you give me the context of how I woud use that? I'm pretty sure Y is actually the one rotation that won't be affected by spherical gravity.

0

is this whats happening? https://imgur.com/a/8SIOuJt

0

Sort of, except that I want the player straight up instead of facedown, the models that you posted were facing in weird directions. https://imgur.com/a/9fXciLT

1 answer

✓ Accepted answer
player.HumanoidRootPart.CFrame = 
CFrame.new(player.HumanoidRootPart.Position, planet.Position) * CFrame.fromEulerAngles(math.deg(-90),0,0);

offsetting the rotation should help

5 comments

0

Multiplying it by an offset seems to be what I need, but for some reason it's giving this error: attempt to call field 'fromEulerAngles' (a nil value)

0

fromEulerAngles just needed an XYZ at the end of it. But now the player seems to be somewhat upright but it jittering like crazy.

0

oh yeah i forgot the "XYZ", maybe its that the player is trying to correct itself back to standing upright?

0

Okay, I finally got it working pretty well. Using a BodyGyro instead of directly setting the player's rotation stops the flickering, and deg should have been rad. player.HumanoidRootPart.BodyGyro.CFrame = CFrame.new(player.HumanoidRootPart.Position, planet.Position) * CFrame.fromEulerAnglesXYZ(math.rad(90),0,0);

0

glad you got it working

This discussion is preserved as it was. New answers, comments, and votes are closed.