hungries = script.Parent function findTarget() for _,v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") then magnitude = (hungries.Position - v.Position).magnitude print(magnitude) local b = Instance.new('BodyAngularVelocity') b.maxTorque = Vector3.new(math.huge, math.huge, math.huge) b.angularvelocity = Vector3.new(0, magnitude, 0) b.Parent = hungries end end end while true do wait(1) findTarget() end
I dont have a humanoid in the model so I cant use MoveTo(). Atm it prints any random magnitude but I will add a findnearest part bit to it in the future. Also do parts and players share a common variable that could make it follow both? thx
try to make the script to change the camera subject to the part and change the camera type to follow. for example:
game.workspace.CurrentCamera.CameraSubject = Part cam.CameraType = Enum.CameraType.Follow