Hi, I'm trying to make a brick point where the mouse is pointing using body gyro! Any ideas? Thanks!
To do this, you're going to have to have some insight on CFrames.
There is a CFrame constructor that takes in 2 arguments:
Pretty self explanatory.
If you use the CFrame constructor, you can provide the brick's Position as the origin argument, and the mouse's hit Position as the look point. This will create a CFrame that is located at your object, and looking at your mouse.
Then all you have to do is apply the CFrame to a BodyGyro object.
local plr = game.Players.LocalPlayer; --The player local mouse = plr:GetMouse(); --The mouse local obj = workspace.Part1; --The object game:GetService("RunService").RenderStepped:connect(function() --CFrame construct local cf = CFrame.new(obj.Position,mouse.Hit.p); --Locate the BodyGyro local bg = obj:FindFirstChild("BodyGyro"); --Manipulate it bg.P = obj:GetMass()*1000; bg.D = 500; bg.MaxTorque = Vector3.new(5000,5000,5000); bg.CFrame = cf; end)