I'm making a 2d game where when you press "s" the player points towards the camera without moving.
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
.
local player = game:GetService("Players").LocalPlayer local usi = game:GetService("UserInputService") usi.InputBegan:connect(function(obj) if obj.KeyCode == Enum.KeyCode.F then local character = workspace:FindFirstChild(player.Name) local camera = workspace.CurrentCamera character.HumanoidRootPart.CFrame = CFrame.new(character.HumanoidRootPart.CFrame.p, camera.CFrame.p * -1) end end)