Attach Character to Part

Hello! I have welded a character to a part and although it mostly works, it interferes with changing the CFrame of that part. When I try to rotate the part, the character resists and keeps it aligned with the world up vector <0, 1, 0>.

Just to be specific, when I say I am changing the CFrame, I mean that every frame, I lerp the CFrame so that its up vector is aligned with the surface normal of the surface the part is on.

My goal is to find a way to make the character always some position and orientation relative to the object. The character should be more of an accessory and should not be influencing the motion of the object in any way. I just want the character to always be stuck to the object

NOTE: I set the character’s JumpPower to zero and MoveSpeed to zero and UseJumpPower to true.

Here is a video of the character resisting this change while on a ramp; notice that the scooter has a slightly jittery motion because of this. Not welding the player fixes this issue, but then the other solution I thought of is constantly updating the character’s position every frame on the server side which is inefficient, especially with multiple players in game:

Here is the code for welding in case it helps; it is called every time the player’s character spawns in with a model (named “scooter”):

local weld = Instance.new("WeldConstraint")
weld.Part0 = scooter.PrimaryPart
weld.Part1 = character.PrimaryPart
weld.Parent = scooter.PrimaryPart
1 Like

bumping due to no responses; can’t wait to finish this tho as it’s one of the last big hurdles for me to finish this scooter project (I disabled animations in the recording of the video so they wldnt distract)

I believe turning EvaluateStateMachine to false on the player’s humanoid will counteract the default character scripts, although I’m sure there are repercussions to that method.

1 Like

Could probably use something similar to the basic mount coding people use here and simply edit the “mounts” offset to where you want the player to be held - i.e. beside instead of on top.

Thank you for your responses! Disabling the state evaluation solved the issue. I appreciate your time and help.

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