When setting the Velocity of a unachored part that is welded to another anchored part, the other part will also have its Velocity affected.
In the video above, I created an example of the bug :
The Yellow Part : A anchored part (Named AnchoredPart)
The Green Part : A unanchored part (Named LeftConveyor) , welded to the Yellow Part
The Red Part : A unanchored part (Named RightConveyor) , welded to the Yellow Part
Below is the script used to set the velocity of the green and red part.
for i,v in script.Parent:GetDescendants() do -- Sets everything to 0 Velocity to help test bug easier
if v.ClassName == "Part" then
v.Velocity = Vector3.new(0,0,0)
end
end
-- now lets give each conveyor their own velocity
script.Parent.AnchoredPart.LeftConveyor.Velocity = Vector3.new(-50,0,0) -- this should set only the LEFT conveyor
script.Parent.AnchoredPart.RightConveyor.Velocity = Vector3.new(50,0,0) -- this should set only the RIGHT conveyor
-- Actual Result :
-- Every part welded to the AnchoredPart including AnchoredPart will have the Velocity from line 8 (RightConveyor)
This script is setting the velocity of the green part to Vector3.new(-50,0,0) and the red part to Vector3.new(50,0,0)
Both green part (LeftConveyor) and red part (RightConveyor) should have different Velocity’s, but both parts (including the yellow part which I did not set a velocity to), all have the same velocity which is the last Velocity set by the script which was for the red part.
Expected behavior
I expect that when I set the Velocity to one part, it does not affect the Velocity of any other part.
Work around : Anchor both the green part and the red part, and both parts will have their Velocity set normally as shown in the script.