Setting Position and/or CFrame of a cloned part shifts the player to the side slightly

I’m trying to set the position of a cloned part to a certain position, but it shifts the player to the side slightly every time it happens.

Collisions are off for the part and it is massless

PartClone.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(-2, 0, 0) * CFrame.Angles(0, 0, 0)
1 Like

From what I tested in studio it worked fine using this code alone, could I see the rest of the code?

1 Like

This is the only relevant part of the code that could be the problem:

PartClone = BasePart:Clone()

PartClone.Parent = Tool
local Motor6D = Instance.new("Motor6D")
Motor6D.Name = "LeftGrip"
Motor6D.Parent = LeftArm
Motor6D.Part0 = LeftArm
Motor6D.Part1 = PartClone

PartClone.CanCollide = false

PartClone.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(-2, 0, 0) * CFrame.Angles(0, 0, 0)
2 Likes

is BasePart 1 part or does it have children that are also parts

Yeah as noob said, I’m trying this program with a singular part. If it’s multiple parts it could be possible collision is still enabled on one of them or some other factor of the parts.

It is a singular mesh with no children, but is inside a folder.

1 Like

If you could give or show all the data to the mesh it’d help figure out the issue.


1 Like

Apologies for the late response,

From what I’ve been testing it appears in your code your last line:

PartClone.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(-2, 0, 0) * CFrame.Angles(0, 0, 0)

IS the issue, I discovered simply removing this line makes it run without shifting. My belief is it has to due with some issue with referencing HumanoidRootPart, however I am not well knowledged in this problem.

What you could try to do (which worked for me) is use the LeftHand’s CFrame as refrence, and tweak the numbers to get your desired position.

Let me know how this goes.

I have already decided on using a different solution to my problem instead. Thank you for trying anyways.

1 Like