Rotate player to be face down?
So I've been stuck on this seemingly simple problem.I'm trying to make it so when a player's health hits 1,a death animation is played.But,I can't seem to be able to figure out how to rotate the player to fall on its face.Here is the code for the localscript:
01 | while game.Players.LocalPlayer.Character = = nil do |
05 | local Character = game.Players.LocalPlayer.Character |
06 | local Humanoid = Character.Humanoid |
08 | Humanoid.HealthChanged:connect( function (Health) |
09 | if Health = = 1 and debounce = = false then |
11 | Humanoid.PlatformStand = true |
14 | Character.Torso.CFrame = CFrame.new(Character.Torso.Position)*CFrame.Angles(math.rad(- 90 ),Character.Torso.Rotation.Y,Character.Torso.Rotation.Z) |
15 | Character.Torso.Anchored = true |
16 | local animation = Instance.new( "Animation" ) |
18 | local animTrack = Humanoid:LoadAnimation(animation) |
21 | animTrack:AdjustSpeed( 0 ) |
23 | animTrack:AdjustSpeed( 1 ) |
26 | animTrack:AdjustSpeed( 0 ) |
How would I make it so the player literally rotates forward on to its face?I spend 3 hours googling this and trying to figure it out,yet I can't seem to be able to find a solution...