Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Rotating a character by the front w/ CFrame? (solved)

Asked by 5 years ago
Edited 5 years ago
    bodygyro = Instance.new("BodyGyro")
    bodygyro.Parent = char.Torso
    repeat wait()
        char.Torso.BodyGyro.CFrame = CFrame.new(char.Torso.Position, mouse.Hit.p)
    until char.Torso.BodyGyro.CFrame == CFrame.new(char.Torso.Position, mouse.Hit.p)
        wait(1)
        fired = false
        bodygyro:Destroy()

This block of code only accomplishes one part of what I what it to do, where it moves the torso slightly towards where the mouse is.

I've never been excellent at lookVector and I don't get a portion of CFrame math, so could someone tell me how exactly to modify this to get the torso to rotate towards the mouse's position or tell me how to use CFrame/lookVector to do this?

0
do a while true do wait() seith14 206 — 5y
0
Why are you using BodyGyro? You can just CFrame the HumanoidRootPart seith14 206 — 5y

Answer this question