Why does the GetVelocityAtPosition method behave inconsistently?

I made a test where there are two propellors. Both have an attachment at one of their tips. These attachments are used to get the positions of the tips. I wrote a script that creates a debug part that represents the vector PropellorPart:GetVelocityAtPosition(Attachment.WorldPosition).

As you can see in the video, the plane propellor does not have a visible debug vector, while it is clearly moving. However, the simple windmill behaves as expected. How is this possible? Why does the debug vector of the plane’s propellor not mimic the actual velocity of the propellor tip?

I am starting to think that this is an engine bug. If this is true, then I will sadly not be able to do anything about it. Roblox has closed the door for role promotion that I need to post bug reports…

The place example in the video is added to this topic.

VelocityAtPosition.rbxl (87.9 KB)

2 Likes

is smol

image

function Vector:Update(Origin, Direction)
	print(Direction.Magnitude)

Doesn’t explain why the 2x longer arm is like 10 as high velocity tho.

Did some investigating, something’s definitely off. Redid the vis script just to triple double verify:

local p = Instance.new("Part")
p.Anchored = true
p.CanCollide = false
p.Parent = game.Workspace
p.Color = Color3.fromRGB(0, 255, 0)

while wait() do
	local pv = script.Parent.Parent:GetVelocityAtPosition(script.Parent.WorldPosition)
	p.Size = Vector3.new(.5, .5, pv.Magnitude)
	p.CFrame = CFrame.new(script.Parent.WorldPosition, script.Parent.WorldPosition + pv) * CFrame.new(0, 0, -pv.Magnitude / 2)
end

Animation3

Same vis for all the propellers, yet the one that’s shaped like a propeller is borked.

Tried removing the angle of attack on the blades, changed nothing.

Let’s replicate it!

Animation4

Still wrong, but annoyingly in a different way (velocity magnitude is higher, but still not the same as the “single-bladed” ones). I wonder what the velocity should be?

Used an AlignPosition to make a Part follow the wing tip, it goes at 2.218 studs / s. None of the velocityAtPositions are correct.

Yeah I’m stumped :-/

1 Like

This is what happens when I speed the plane’s propellors up by ten times:

As you can see, there is no visible change to the situation.

1 Like

Made some edits. It definitely seems like the method is broken.

Here’s how it should work:

function getVelocityAtPoint(part, worldPoint)
	return part.Velocity + part.RotVelocity:Cross(worldPoint - part.Position)
end

function getAttachmentVelocity(attachment: Attachment): Vector3
	return getVelocityAtPoint(attachment.Parent, attachment.WorldPosition)
end

You might just have to use that until it gets fixed :c

9 Likes

Thanks for the workaround! I am not sure about what exactly broke it, but that is up to Roblox to fix.

EDIT: I read your first comment, where you ran some tests. The test results are very confusing, but insightful of course.

2 Likes

How would you negate the velocity that occurs lets say if you only want to find the velocity in one axis?