AssemblyLinearVelocity not working

I have a gui which shows me the AssemblyLinearVelocity of a object in a model (train). Odd thing is, when the train occasionally gets stuck, it displays its AssemblyLinearVelocity as 40 but the train is not moving. It is using body velocity. The gui is working fine.

If when train gets stuck, the body velocity is still working, then of course AssemblyLinearVelocity is not going to change, because Body Velocity applies velocity to the train every frame, so it doesnt really care if the train is moving forward, or stuck because there is a wall in front of it.

Your solution is to either not make it get stuck, or if it getting stuck is intentional, disable body velocity when it does so.

To give a real life example, if you push a heavy box and it moves, and then you push a wall that doesnt move, you are still applying the same amount of force in both cases. The subject moving or not isn’t relevant.

When i place a part infront of the train, blocking it, it stops and its AssemblyLinearVelocity goes to 0 even though it has a body velocity. however, sometimes when it gets stuck, its AssemblyLinearVelocity is at 40 and it always gets stuck at the same spot, down to the same stud

how would i check if something is moving tho

Then solve the problem of randomly getting stuck, instead of what velocity it has When getting stuck. You are approaching your issue wrong.

By checking it’s position constantly and comparing it to previous position, the scripting of which I trust to you.