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

My head-camera script isn't working how it should(Motor6D Transform)?

Asked by
Jo_Bot 67
6 years ago

I wrote this script for a custom character with a neck Motor6D inside the UpperTorso that connects the Head to the UpperTorso. I feel that this should work, but for some reason it is not. The Transform of the Motor6D is changing, but it isn't visual, just in the output from the print line(line 13).

local player = game.Players.LocalPlayer
local character = player.character
local head = character.Head
local uppertorso = character.UpperTorso
local lowertorso = character.LowerTorso
local camera = game.Workspace.CurrentCamera
local uis = game:GetService("UserInputService")
local rs = game:GetService("RunService")

while wait() do
    local camangle = camera.CFrame.lookVector
    uppertorso.Neck.Transform = uppertorso.Neck.Transform * CFrame.new(math.rad(camangle.X),math.rad(camangle.Y),math.rad(camangle.Z))
    print(uppertorso.Neck.Transform)
end
0
Local script or? Bellyrium 310 — 6y
0
Yes, local script in StarterPlayer scripts. Jo_Bot 67 — 6y

Answer this question