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

why isn't my bodygyro script not rotating my character?

Asked by
wookey12 174
5 years ago
Edited 5 years ago
local plr = game.Players.LocalPlayer
local char = plr.CharacterAdded:Wait()
local tool = script.Parent
local ready = true
tool.Equipped:Connect(function(mouse)
    mouse.Button1Down:Connect(function()
        if ready == true then
        ready = false
        print("hi")
        local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit * 300)
        local part, hitPosition = workspace:FindPartOnRay(ray, char)
        local bodyGyro = Instance.new("BodyGyro", char.Torso)
        bodyGyro.CFrame = CFrame.new(bodygyro.Parent.Position, hitposition)
        bodyGyro.MaxTorque = Vector3.new(8000000000, 0, 8000000000)
        wait(3)
        end
        ready = true
    end)

end)
0
it does rotate, but very slowly, and it keeps rotating. it doesnt stop when it rotates towards the object wookey12 174 — 5y

1 answer

Log in to vote
0
Answered by
wookey12 174
5 years ago

The y axis in maxforce was 0, i forgot that the character rotates on the y axis, haha

Ad

Answer this question