Issue Type: Other Impact: Moderate Frequency: Often Date First Experienced: 2021-02-05 18:02:00 (-06:00) Date Last Experienced: 2021-02-06 11:02:00 (-06:00)
If you set the AssemblyLinearVelocity before it is parented to workspace, it will be set to 0, 0, 0. If you set AssemblyLinearVelocity after it is parented to workspace, it will stay the same as what you set it to.
If you change AssemblyLinearVelocity to Velocity, it works whether you set the parent before or after.
Expected Behavior:
I would expect that AssemblyLinearVelocity would not reset itself when it is parented from workspace, but would stay the same as what it was set to. This is how the deprecated Velocity property worked.
Actual Behavior:
When you set AssemblyLinearVelocity before parenting the part:
When you set AssemblyLinearVelocity after parenting the part:
When you set Velocity either before or after parenting the part:
Workaround:
Setting the AssemblyLinearVelocity property after setting the Parent property.
I’m not completely sure whether this is a bug or if it’s intentional, but I’m posting it anyways because I’m not sure. It just seems to make more sense for AssemblyLinearVelocity to behave the same way as Velocity did.
The blue part has AssemblyLinearVelocity set before Parent, and it gets set to 0, 0, 0 on its own. The red one has Parent set before AssemblyLinearVelocity and it works properly.
Here is the script:
-- Set AssemblyLinearVelocity first
local part = Instance.new("Part")
part.Name = "AssemblyLinearVelocity First"
part.Anchored = true
part.BrickColor = BrickColor.Blue()
part.Size = Vector3.new(5, 1, 5)
part.CFrame = CFrame.new(0, 5, 5)
part.AssemblyLinearVelocity = Vector3.new(0, 0, 10)
part.Parent = workspace
-- Set Parent first
local part = Instance.new("Part")
part.Name = "Parent First"
part.Anchored = true
part.BrickColor = BrickColor.Red()
part.Size = Vector3.new(5, 1, 5)
part.CFrame = CFrame.new(0, 5, -5)
part.Parent = workspace
part.AssemblyLinearVelocity = Vector3.new(0, 0, 10)
AssemblyLinearVelocity operates on assemblies. Assemblies are a physics concept that only applies to parts in a physical world. Thus, if your part isn’t in the Workspace (or a WorldModel), it won’t be part of an assembly, and won’t have an AssemblyLinearVelocity.
So your issue has nothing to do with moving between the Workspace and somewhere else, it’s simply about not being in the Workspace:
local part = Instance.new("Part")
part.AssemblyLinearVelocity = Vector3.new(1, 1, 1)
print(part.AssemblyLinearVelocity) --> 0, 0, 0
Is there something that the old behavior gets you that is hard to accomplish now?