Answered by
7 years ago Edited 7 years ago
Well, it's actually quite simple, and you don't need BodyGyro
at all. Just change the CFrame of the Character's HumanoidRootPart
to the same position, and change the angle to The Camera's CFrame position. Here's an example with what you want to do.
Note: I changed the button you press from S to F so I could make sure it worked. S makes you walk backwards if your game isn't 2D :P. If you want to change it back, change Enum.KeyCode.F
at line 5 to Enum.KeyCode.S
.
01 | local player = game:GetService( "Players" ).LocalPlayer |
02 | local usi = game:GetService( "UserInputService" ) |
04 | usi.InputBegan:connect( function (obj) |
05 | if obj.KeyCode = = Enum.KeyCode.F then |
06 | local character = workspace:FindFirstChild(player.Name) |
07 | local camera = workspace.CurrentCamera |
08 | character.HumanoidRootPart.CFrame = CFrame.new(character.HumanoidRootPart.CFrame.p, camera.CFrame.p * - 1 ) |