Colinchannz
(EveryonesIdol_Carina)
November 13, 2024, 4:45am
#1
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
Duke_2536
(Duke_2536)
November 13, 2024, 5:10am
#2
From what I tested in studio it worked fine using this code alone, could I see the rest of the code?
1 Like
Colinchannz
(EveryonesIdol_Carina)
November 13, 2024, 5:37am
#3
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
Duke_2536
(Duke_2536)
November 13, 2024, 5:06pm
#5
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.
Colinchannz
(EveryonesIdol_Carina)
November 13, 2024, 10:01pm
#6
It is a singular mesh with no children, but is inside a folder.
1 Like
Duke_2536
(Duke_2536)
November 15, 2024, 8:45pm
#7
If you could give or show all the data to the mesh it’d help figure out the issue.
Duke_2536
(Duke_2536)
November 18, 2024, 12:28am
#9
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.
Colinchannz
(EveryonesIdol_Carina)
November 18, 2024, 9:19pm
#10
I have already decided on using a different solution to my problem instead. Thank you for trying anyways.
1 Like