AssemblyLinearVelocity not working

I am trying to make a game about throwing bricks at people, but my brick seems to begin falling i do something (I don’t know what).

Code:

script.RemoteEvent.OnServerEvent:Connect(function(Player, Hit:Vector3)
	OurPlayer = Player.Character
	if script.Parent:FindFirstChild("Handle") and (script.Parent.Handle.Position - Hit).Magnitude < 50 and Activated == false then
		Activated = true
		CanHit = true
		local Handle = script.Parent.Handle
		Handle.CanCollide = true
		Handle.Parent = script.Parent.Parent
		Handle.AssemblyLinearVelocity = (Hit - Handle.Position) * Vector3.new(2, 2, 2)
		print(Handle.AssemblyLinearVelocity)
		local Prompt = Instance.new("ProximityPrompt", Handle)
		Prompt.ObjectText = Player.Name .. "'s " .. script.Parent.Name
		Prompt.ActionText = "Grab"
		Prompt.Triggered:Connect(function(PlayerTrig)
			if PlayerTrig == Player then
				Prompt:Destroy()
				Handle.Parent = script.Parent
				Handle.CanCollide = false
				CanHit = false
				Activated = false
			end
		end)
	end
end)

not gonna leak the whole thing cause nope
low on sleep rn

Don’t really know what the issue is, can you clarify what you mean?

Is the part falling down due to gravity and you’d like it to not do that?

2 Likes

I mean that it won’t fling whatsoever. Let me get a video for you…

1 Like

the part is welded to the right arm, destroy the weld (its inside the right arm)

It is definitely NOT welded to the arm when I throw it. I have no idea what you mean.

just multiply the force to something higher? multiplying by 2 is like nothing, try higher numbers

That isn’t the problem. At first, it flies! Later, after I throw it about five times, it stops throwing and just falls.

network ownership then, try setting network ownership to server

1 Like

Nope. Still breaks.

Hey! The reason your brick is falling might be because of how you’re setting the velocity.

In this line:

Handle.AssemblyLinearVelocity = (Hit - Handle.Position) * Vector3.new(2, 2, 2)

You’re scaling the direction using Vector3.new(2, 2, 2) — which multiplies each axis separately. This could cause strange physics behavior (like dropping down too fast), especially if the Y value ends up small Try this instead:

local direction = (Hit - Handle.Position).Unit
local force = 100 -- tweak this to change how far the brick goes
Handle.AssemblyLinearVelocity = direction * force

This gives it a consistent push toward the target, and the physics will work more naturally.

Also, make sure Handle.Anchored = false before throwing, or else velocity won’t apply.

Let me know if that helps

1 Like

This is not the problem. If you check the video, it won’t move whatsoever.

If the brick is just falling and not moving forward, the velocity might not be applying correctly. Try this:

local direction = (Hit - Handle.Position)
if direction.Magnitude == 0 then
	direction = Vector3.new(0, 1, 0)
end

direction = direction.Unit
local force = 100
Handle.AssemblyLinearVelocity = direction * force

Also make sure:

  • Handle.Anchored = false
  • You’re setting the velocity after parenting and enabling collisions
  • Nothing else in the code or other scripts is overriding the movement

Let me know if that helps or if it still doesn’t move.

I have printed the velocity in earlier testing sessions. It would always print it was working, but never work.

This is a property that is often immediately overwritten by other physics operations, usually requiring you to set it to something absurdly high. Try using BasePart:ApplyImpulse(directionForce : Vector3) instead, this is best for ‘flinging’ type effects and the physics engine handles it more appropriately.

1 Like

Doesn’t fix it… Just acts like the original script.

Try applying more force. A magnitude of a 2,2,2 vector is very small. Also, you don’t need to multiply vectors by vectors, you can just multiply it by a number. Also, you can try adding a task.wait() to allow the physics engine to catch up with the fact the Handle is no longer attached. I would also ensure the handle is actually no longer welded, try to see if it retained any welds or the hand has retained welds to it. That could cause it to go nowhere.

1 Like
local CanHit = false
local Activated = false
local OurPlayer = script.Parent.Parent
script.Parent.Handle.Touched:Connect(function(OtherPart)
	local Player = OtherPart.Parent:FindFirstChildOfClass("Humanoid")
	if Player and Player.Parent ~= OurPlayer and Player.Health > 0 and CanHit == true and Activated == true then
		CanHit = false
		Player.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(script.Parent.Damage.Value)
		game.Players:GetPlayerFromCharacter(OurPlayer).leaderstats.Money.Value += script.Parent.DamageIncome.Value
		script.Parent.Hits.Value += 1
	end
end)
script.RemoteEvent.OnServerEvent:Connect(function(Player, Hit:Vector3)
	OurPlayer = Player.Character
	if script.Parent:FindFirstChild("Handle") and (script.Parent.Handle.Position - Hit).Magnitude < 50 and Activated == false then
		Activated = true
		CanHit = true
		local Handle = script.Parent.Handle
		--Handle:SetNetworkOwner(game.Players:GetPlayerFromCharacter(Player))
		Handle.CanCollide = true
		Handle.Parent = script.Parent.Parent
		Handle:ApplyImpulse((Hit - Handle.Position) * Vector3.new(30, 50, 30))
		local Prompt = Instance.new("ProximityPrompt", Handle)
		Prompt.ObjectText = Player.Name .. "'s " .. script.Parent.Name
		Prompt.ActionText = "Grab"
		Prompt.Triggered:Connect(function(PlayerTrig)
			if PlayerTrig == Player then
				Prompt:Destroy()
				Handle.Parent = script.Parent
				Handle.CanCollide = false
				CanHit = false
				Activated = false
			end
		end)
	end
end)
script.Parent.Activated:Connect(function()
	script.RemoteEvent:FireAllClients()
end)
while wait(math.random(script.Parent.MoneyRateMin.Value, script.Parent.MoneyRateMax.Value)) do
	Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
	if Player then
		Player.leaderstats.Money.Value += script.Parent.MoneyIncome.Value
	end
end

Thanks for the details — yeah, you’re absolutely right that AssemblyLinearVelocity can get overridden fast, and ApplyImpulse is usually better for these kinds of fling actions.

A few extra things that might help:

  • Try adding task.wait(0.1) right after setting Handle.Parent = script.Parent.Parent before applying the impulse. That small delay gives time for physics and welds to update properly.
  • Double-check that all welds are removed from the Handle (and from the player’s hand/arm). Even invisible motor welds like Motor6D or WeldConstraints will block movement.
  • Try calling Handle:BreakJoints() before applying the force, just in case any leftover constraints are still there.
  • Also, make sure the Handle is network-owned by the server at the moment you apply the impulse. Otherwise, the client might override the movement.

You could also try something like this for clarity:

Handle.Parent = workspace
task.wait(0.05)
Handle:BreakJoints()
Handle:ApplyImpulse((Hit - Handle.Position).Unit * 500)

If that still doesn’t move, maybe log .Parent , .Anchored , and see if it’s even being simulated correctly at that moment.

1 Like

Did you seriously just send me ChatGPT slop? Seriously?

yeah I did because it gave me the full answer in 30 seconds. What did you find? looks like nothing to me cuz ur asking for help