Why doesn't .AssemblyLinearVelocity work?

  1. What do you want to achieve? Keep it simple and clear!
    I want to make an uppercut, which knocks both dummies and players upward into the sky.

  2. What is the issue? Include screenshots / videos if possible!
    When playtesting the script, it appears to work for the dummies, but when I boot up a local server and uppercut a player, nothing happens.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried searching on the DevForum, as well as trying LinearVelocity, but it doesn’t give results that I want. I’m trying to make an uppercut system like The Strongest Battlegrounds.

Humanoid.Parent:WaitForChild("HumanoidRootPart").AssemblyLinearVelocity = Character:WaitForChild("HumanoidRootPart").CFrame.UpVector * 60
1 Like

ApplyImpulse() might work better

1 Like

Okay, I will try that right now and return results.

2 Likes

By the way this a module script in a server script. So do I have to use a remotefunction to connect the script to a local script?

1 Like

I believe it would be best for the impulse to be applied server-side. I don’t think it will work locally when you’re dealing with player-to-player interaction (if i understood correctly). Btw. about applying impulses on players in general, I think you might also want the hitted player to ragdoll before applying the impulse, as player controllers kind of stick to the ground unless they are affected by larger impulses

2 Likes

Yeah, it’s better to do it server-side. I made a local script, played the animations on the client, used :InvokeServer() then did damage on the server.

Edit: I put little force on the parameter for ApplyImpulse(), so I increased it,

-- before
Humanoid.Parent:WaitForChild("HumanoidRootPart"):ApplyImpulse(Vector3.new(0, 60, 0))

-- after
Humanoid.Parent:WaitForChild("HumanoidRootPart"):ApplyImpulse(Vector3.new(0, 1000, 0))

And it makes sense in a way to do damage on the server, because everyone should see that.

2 Likes

Nice, does it work?ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ

1 Like

Well it works on singleplayer. Now to test with a local server. This’ll take a minute or two.

2 Likes

Sadly, it didn’t. I guess I’ll stick to LinearVelocity, cause it works with both dummies and players.

1 Like

Oh well, LinearVelocity is a solid option indeed.

1 Like

Yeah, before I was just using .Velocity which was deprecated. Only problem I have is that for like a second or two the dummy/player floats in the air like they’re Jesus or something rather than falling back down.

1 Like

Are you setting the assembly linear velocity on the server or the client? The property isn’t replicated so setting that property on the server for an assembly that is owned by the client (ie the character) won’t have any effect. You would have to set the assemblylinearvelocity on the client

1 Like

Yeah, but how would I do that in a module? Using a remotefunction? I’m confused whether I should do knockback with the server or on the client.

Edit: I’m gonna rework the combat system. Cause if one thing doesn’t work everything after that won’t as well.

1 Like

In this link/solution, i provided someone with some code how AssemblyLinearVelocity works How To Use AssemblyLinearVelocity? - #2 by BobbieTrooper

And the best thing u could do is to calculate the knockback on the server, for security reasons but also because you have full control.
And u could use client-sided codes to create a smooth animation and effects.

If necessary, temporarily transfer network ownership of the player’s character to the server during the knockback calculation to ensure accuracy: Network Ownership | Documentation - Roblox Creator Hub

Also use RemoteEvents to communicate knockback information between the server and clients.

1 Like

So do I say:

Character:SetNetworkOwnership(Nil)
1 Like
-- Set NetworkOwnership to server temporarily
  player.Character.HumanoidRootPart:SetNetworkOwner(nil)

-- Knockback code

-- Return player to client ownership
  player.Character.HumanoidRootPart:SetNetworkOwner(player)
2 Likes

How would I make a stagger animation when the player uppercuts the opponent? I already have one. Just need to script it.

1 Like

Well basically, just sent a signal to the client and play the animation there

I don’t really have expierence with animations tbf

1 Like
Character:WaitForChild("HumanoidRootPart"):SetNetworkOwner(nil)
				
Humanoid.Parent:WaitForChild("HumanoidRootPart").AssemblyLinearVelocity = Character:WaitForChild("HumanoidRootPart").CFrame.lookVector * 60
				
task.wait(1)
				
Character:WaitForChild("HumanoidRootPart"):SetNetworkOwner(Player)

it’s not working or am i doing something wrong

1 Like

This is on a serverScript right?

if Yes, great, also

local humanoidRootPart = Character:WaitForChild("HumanoidRootPart")

humanoidRootPart:SetNetworkOwner(nil)
humanoidRootPart.AssemblyLinearVelocity = humanoidRootPart.CFrame.LookVector* 200
task.wait(1)
humanoidRootPart:SetNetworkOwner(Player)

If you want to player to launce upwards, u can use UpVector instead of LookVector

2 Likes