local lookAtXZ
local newRootCF
function CharacterFaceCamera()
lookAtXZ = HumanoidRootPart.Position + Vector3.new(Camera.CFrame.LookVector.X, 0, Camera.CFrame.LookVector.Z)
newRootCF = CFrame.new(HumanoidRootPart.Position, lookAtXZ)
local tweenInfo = TweenInfo.new(
0.15,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
local tween = TweenService:Create(HumanoidRootPart, tweenInfo, {["CFrame"] = newRootCF})
tween:Play()
end
RunService:BindToRenderStep("cameraControl", Enum.RenderPriority.Camera.Value, LockCamera)
RunService:BindToRenderStep("characterFaceMouse", Enum.RenderPriority.Character.Value, CharacterFaceCamera)
In my game I have code that will basically point the HumanoidRootPart towards the mouse, but I want the UpperTorso, LowerTorso, Arms, Head to bend and point up and down depending on where the player is aiming but I have no idea how to do this.
You could try simply bending the UpperTorso and HumanoidRootPart at the same time. Since the arms and Head are all connected to the UpperTorso, I’m pretty sure the arms will move with the UpperTorso, similar to how they move if you’ve ever used Animation Editor.