Why is AssemblyLinearVelocity behaving this way?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    An accurate velocity.
  2. What is the issue? Include screenshots / videos if possible!
    Inaccurate velocity, the velocity goes wack when I hit a wall.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Tried spawning a part that goes with the player instead of relying on the rootPart, yielded the same result.
game:GetService("RunService").Heartbeat:Connect(function()
	print((root_part.AssemblyLinearVelocity*Vector3.new(1, 0, 1)).Magnitude)
end)

this is quite literally all the code there is

Behaving in what way? I don’t understand.

Let me provide a video my bad, I thought I did:

As you can see in the video, the velocity works as intended prior to bumping into the wall. After bumping into it though, things get weird for some reason and I don’t know what’s causing this? I have replicated this issue on another blank baseplate and same result. When it works as intended, the value drops to zero, as it should. When it works not as intended, I don’t even know how to describe it.

You should have described the issue is non zero, weird numbers.

The issue is just floating point errors those 1e-7 is equal to 0.0000001 which is basically 0, use math.round up to a certain decimal point to get a nicer number

Right, my bad, it was 12 am when I wrote this couldn’t really see well. Thanks for answering, I think this is the solution.

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