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

How do i make a Character's UpperTorso face a position using Motor6D?

Asked by 4 years ago

Brief explanation of my script: I tried using Renderstepped to constantly make the UpperTorso face the "Mouse.Hit" on every frame.

Here's my Script:

local Player = game.Players.LocalPlayer
local Character = Player.Character
local Mouse = Player:GetMouse() -- Mouse
local Aim = false


Mouse.Button1Down:connect(function()
    Aim = true
end)
Mouse.Button1Up:connect(function()
    Aim = false
end)

local Center = Character.UpperTorso.Waist  --Waist of the UpperTorso (MOTOR6D)


game:GetService("RunService").RenderStepped:Connect(function(x)
    if Aim == false then return end
    Center.C0 = CFrame.new(Center.C0.Position, Mouse.Hit.Position)
end)

I also read to use Transform but the problem is that when I tried setting the CFrame for transform, nothing happened.

0
Couldn't you just use "Character.UpperTorso.Waist.CFrame = CFrame.new(Character.UpperTorso.Waist.Position, Mouse.Hit.Position)"? youtubemasterWOW 2741 — 4y
0
No sir, I cannot. Reason why is because that will rotate the entire character, which is what I do not want. I want to rotate from the UpperTorso and up only. davie10863 9 — 4y
0
That will break the character's jonts... alexfinger21 341 — 4y
0
joints* alexfinger21 341 — 4y
View all comments (2 more)
0
joints* alexfinger21 341 — 4y
0
@alexfinger21 . What are you talking about? Are you saying my method is wrong? Please tell me the correct way to rotate it if so. davie10863 9 — 4y

Answer this question