You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I need the neck to turn but its not working
What is the issue? Include screenshots / videos if possible!
(sorry for the long video the pausing didn’t work)
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
tried to get some solutions on yt and dev forum but they dont work and when i try to do it myself the whole character starts turning
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
this is some of the code in it:
elseif input.KeyCode == Enum.KeyCode.Thumbstick2 then
if char then
if tomove[num] then
tomove[num] = CFrame.new(tomove[num].Position)*CFrame.Angles(0,math.rad(-thumbstickCurve(input.Position.X)*5),0)
else
tomove[num] = CFrame.Angles(0,math.rad(-thumbstickCurve(input.Position.X)*5),0)
end
tomovehead[num] = CFrame.Angles(math.rad(-thumbstickCurve(input.Position.Y)*5),0,math.rad(-thumbstickCurve(input.Position.X)*5))
end
end
for i,v in pairs(tomovehead) do
print(i,v)
if workspace:FindFirstChild("Player"..i) then
local player = workspace:FindFirstChild("Player"..i)
local y = player.Torso.Neck.C0.Y
player.Torso.Neck.C0 *= v * CFrame.Angles(0,y,0) * CFrame.Angles(3*math.pi/2,0,math.pi)
player.Torso.Neck.C1 *= v * CFrame.Angles(0,y,0) * CFrame.Angles(3*math.pi/2,0,math.pi)
end
end
(thumbstick curve function is in one of roblox’s moving scripts)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
You’re applying the same rotation both parts of the Motor6D. I’m not really sure what rotation v represents, but if its how much you want to rotate the head by from its current position, it should be:
player.Torso.Neck.C0 *= v
If its the absolute rotation relative to your character, it should be:
player.Torso.Neck.C0 = player.Torso.Neck.C0.Position + player.HumanoidRootPart.CFrame.Rotation * v
Torso is usually aligned with the HumanoidRootPart which is controlled by the Humanoid. You could try adjusting C1 instead of C0, and that might work. I don’t know your exact setup, but for me, with the default R15 rig, something like this works fine:
while task.wait(1) do
local motor = script.Parent.Head.Neck
motor.C0 *= CFrame.Angles(45, 0, 0)
end
^ Add a new rig to Workspace with Rig Builder and parent the Script inside.
everything in the script is local, im using an r6 rig and even when i do .C1 the whole body turns with it and thats the new problem (was happening with C0 also) the difference is that the neck motor is in the torso in an r6 rig but in an r15 one the neck is in the head
so just a quick rundown of the script, a person connects with one or more controllers (im using 2 for this instance) and presses the play button, it configures the stuff like putting the characters in a viewport frame for the splitscreen effect and constantly updating it with a .RenderStepped event, in the rendestepped event, the movements, turning, pivoting, etc happens, but the turning is the problem