Error when trying to set AssemblyLinearVelocity

I’m trying to set the AssemblyLinearVelocity of the HumanoidRootPart in the X and Z axis. To do so, I’m using this line of code:

script.Parent.HumanoidRootPart.AssemblyLinearVelocity.X = script.Parent.HumanoidRootPart.CFrame.LookVector.X * 35

However, I am getting this error:

X cannot be assigned to

Does anybody know why this happens? I have no idea of what’s the problem.

2 Likes

Unfortunately it’s not currently possible to edit each axis individually (due to Vector3 axis being read-only), which is admittedly incredibly annoying

As a workaround, you’ll need to multiply the value with Vector3.xAxis, like so:

script.Parent.HumanoidRootPart.AssemblyLinearVelocity = script.Parent.HumanoidRootPart.CFrame.LookVector * (Vector3.xAxis * 35)
2 Likes

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