Weird part behaviour with LinearVelocity

Hello, I have a script that moves a part forward and it works well apart from the one end of the part starts to raise up as it moves along.
Screenshot 2022-09-16 102830

Here is the properties for my LinearVelocity
Screenshot 2022-09-16 103045

local Linearvelocity = script.parent.parent.LinearVelocity 

script.Parent.Triggered:Connect(function()
	
	Linearvelocity.LineVelocity = (1)
	wait(3)
	Linearvelocity.LineVelocity = (2)
	wait(3)
	Linearvelocity.LineVelocity = (3)
	wait(3)
	Linearvelocity.LineVelocity = (4)
	wait(3)
	Linearvelocity.LineVelocity = (5)
	wait(3)
	Linearvelocity.LineVelocity = (6)
	wait(3)
	
	end)
	


There’s my script I used.

I have no idea what could be causing this problem, thank you fin advance for any help.

1 Like

Im not exactly sure what you mean by the one end of the part raising up, but can’t you use AssemblyLinearVelocity for this? It sounds like you’re trying to make a conveyor.

So you want no y forces right?

You can try plane mode, or try using enum relative to world

1 Like

Just adding on.

This is almost definitely happening because RelativeTo is set to Attachment0. RelativeTo tells Roblox how to decide what the direction the velocity goes should be. For example, if the velocity is 16 (same as the default player speed) and RelativeTo is Attachment0, the velocity that’s applied will go in the direction that Attachment0 is facing. If the part rotates, the direction of velocity rotates with it too.

What is likely part of the problem is that your Attachment0 probably isn’t at the center of the part (which is where its center of mass is). The LinearVelocity might then be moving the part upwards initially (at the point where your attachment is). But, kind of like a lever the part will rotate because gravity is pulling the other side down. That means your part would be rotating around its center of gravity, since the direction Roblox moves it is constantly changing.

Personally, when I do want to use RelativeTo that isn’t World, I find it a little hard to tell what direction attachments face (because across different constraints Roblox interprets this very differently) and what I usually like to do is rotate them in Run mode with no player, and see what direction the arrows point.


As for how you might solve this, it depends what you’re trying to actually do. From your screenshot, it’s not immediately obvious what your goal is, and you haven’t said anything in your main post.

@dthecoolest’s suggestion is probably at least partially what you want, if not the full solution. Particularly, setting the RelativeTo to World would definitely stop the rotating, since now, if the part rotates, the direction of the velocity won’t, which, may or may not be what you want. That way, if the attachment moves or rotates, it won’t make the direction change at all, it will always go the same way.

1 Like

Using line and plane does stop it from floating around, but then It’s impossible to make the part turn. I noticed somebody else wondered if I was making a conveyor, but it’s supposed to be a boat if that changes anything.

Linear velocity does not apply from center mass. To stop rotation from occurring you need to use an angular velocity instance, with it’s velocity set to 0,0,0 and an maxforce of inf. Linear velocity does not control orientation, allowing for parts to spin and rotate.

1 Like