Waist rotation towards camera direction causing HRP to reorient?

I am working on a character customizer which involves creating robots with a wide variety of parts.

I have it so that if the character has a Neck and a Waist joint, both will turn in tandem towards the cameras look direction, but after finishing found that my current code (specifically the part involving the Waist joint) causes my HRP to rotate as well!

The HRP rotation looks different on the server compared to the client, but this has left me stumped for a few hours now.

Code for Waist turning:

local neckRotationTime = 0.3
local Waist = --find the waist Motor6D
local initWaist = Waist.C1

RunService.RenderStepped:Connect(function()
	local CamDirection = HRP.CFrame:ToObjectSpace(Camera.CFrame).LookVector
	local angle = CFrame.Angles(-math.asin(CamDirection.Y),math.asin(CamDirection.X),0)		
	local newC1 = initWaist * angle
			
	TweenService:Create(Waist, TweenInfo.new(neckRotationTime), {C1 = newC1}):Play()
end)

This behavior is negated with a big enough HRP but I would prefer to figure out what is actually happening or what I have done wrong.

How this is supposed to look (has a HRP big enough to weigh the legs down lol)

Any help is appreciated

2 Likes

Is part 1 the waist or the root part? Pretty sure Part 1 is supposed to have priority over part 0.

No but changing the Part0 and Part1 of the joint doesn’t appear to do anything.

For clarity the rig is HRP > Waist > Torso and the Waist > Torso motor is what I’m looking to correct so I’m really unsure as to what is affecting the HRP

The player has complete control over this right? I’m curious if it’s either a networking, animation or root priority issue, I get you’re tweening the motors but if those are the results of you switching from Client → Server view, it only makes me think that you’re not getting full control over the Model.

Also, regarding motor rotation, I know people send the information over to the server for it to distribute it to all other clients so that they handle all rotations for character models. Kind of how that R15 look direction module works in a way.

Did some research, to see if this might be one of the issues you’re having.

The turning is all done in a local script that’s placed in the character after it is set as the players’ character, if that order can cause issues with ownership or control.

I do use the client > server > client event method for replicating the turning to other players (the player’s character is obviously exempt from it)

Well, a model might be set as the players’ character but that wouldn’t automatically give the player complete ownership of the root/model. You’d need to manually set the ownership to make sure. Did testing regarding that multiple times due to various latency issues and for custom avatars, so it might be a probable cause although unlikely.

I’m believing it be a root priority issue but I don’t really know what would be causing it. The part that seems to be replicating correctly is the Torso and everything reorients to match it instead of the Waist bending as it should.

(Player 1)
image
(Player 2)
image

If it is a priority issue then it confuses me more, as the turning of the Neck joint works perfectly fine and follows the same rig pattern (HRP > Waist > Torso > Head)

What if you change the HumanoidRootPart.RootPriority = 5 or some random number than the default 0 that instances have? Or double checking whether the HumanoidRootPart is the PrimaryPart of the Model.

Something dumb which might be unwanted is to change all connected parts to massless.

1 Like

RootPriority seems to have been the fix :+1:

I don’t know how well massless would have worked (last I tried it started flailing)

Thanks a ton

(I did also set networkownership of all parts just in case)

No problem, I was also curious on what the answer would have been, I’ve had similar motor6d issues but never decided to find the fix.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.