To start off, I'll introduce a body force that you may or may not have heard of, BodyGyro. Put simply, a BodyGyro will influence the rotation of whatever BasePart it is parented to. With this said, we'll be using this as our main means for making our character face his or her camera.
I should also mention that we can set the CFrame of our character without he or she dying, this is because it doesn't break joints or reset welds or anything of that sort. So that's where we'll be putting our BodyGyro.
local player, bG = game.Players.LocalPlayer, Instance.new("BodyGyro", game.Players.LocalPlayer.Character.Torso)
This will make the BodyGyro and put it in our characters torso, but we haven't defined the MaxTorque of the gyro. We need to set it to something that won't cause our character to do back and front flips out of control. For this, we'll set it to 10,000 on the Y-Axis.
bG.MaxTorque = Vector3.new(0, 10000, 0)
So, now we've set up the BodyGyro. Next we just need to set up a loop to set the CFrame of the gyro to face the mouse. For this, we'll get the mouse, and set the CFrame.
while wait() do
bG.CFrame = CFrame.new(player.Character.Torso.Position, player:GetMouse().Hit.p)
end
Hope this helped.
Also, I apologize if I have a flawed understanding and have given poor or inaccurate explainations.
1 comment
I understand where you're coming from, do you mean like design it?