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

object rotating when following mouse?

Asked by 2 years ago

when having an object follow the mouse it's orientation is switching to 0,0,0 when it should be at -90,90,0

here is the code im using Local mouse = Player:GetMouse()

        mouse.TargetFilter = game.Workspace.HAND_TRACER

        while wait() do
            game.Workspace.HAND_TRACER.CFrame = CFrame.new(mouse.Hit.p)

1 answer

Log in to vote
0
Answered by 2 years ago

Use this:

mouse.TargetFilter = game.Workspace.HAND_TRACER

while wait() do
    game.Workspace.HAND_TRACER.Position = mouse.Hit.p
    game.Workspace.HAND_TRACER.Orientation = Vector3.new(-90, 90, 0)
Ad

Answer this question