✓ Accepted answer
BodyMovers allow for the smooth movement and rotation of unanchored parts. They use Roblox physics and include various properties that influence how they move. If you wanted to make an object/model face a specific point, I would recommend BodyGyro. When you set the CFrame property of this BodyMover, it will rotate its parent to adopt the orientation of the CFrame given.
For example, if you wanted to make a humanoid model rotate to constantly face a part called FacePart in workspace, you could do something like this in a script inside the model:
local Model = script.Parent
local Target = workspace.FacePart
local BG = Instance.new("BodyGyro")
BG.MaxTorque = Vector3.new(0,math.huge,0)
BG.Parent = Model.HumanoidRootPart
game:GetService("RunService").Stepped:Connect(function()
local DesiredCFrame = CFrame.new(Model.HumanoidRootPart.Position, Target.Position)
BG.CFrame = DesiredCFrame
end)
The MaxTorque of BodyGyros controls which axes the gyro can apply force to. Since in the script it is only set on the Y-axis, it will only control the "swivelling" of the model.
Hope this helps!
1 comment
You can't use TweenService when a part must face to your direction. Only if you want a part faces to your direction but never moves so it faces to your direction.