I’m trying to use a AssemblyLinearVelocity to throw a character, but they are don’t function in the player character, just NPCs.
Server
local HRP = char.HumanoidRootPart :: Part
local eHRP = target.HumanoidRootPart :: Part
local hm = target.Humanoid :: Humanoid
local Dir = CFrame.lookAt(HRP.Position, eHRP.Position).LookVector
local targetPlr = game.Players:GetPlayerFromCharacter(target)
if targetPlr ~= nil then
Remote:FireClient(targetPlr, Dir * 60)
else
print('a')
eHRP.AssemblyLinearVelocity = Dir * 60
end
Client
game:GetService('ReplicatedStorage').RemoteEvents.AssemblyLinearVelocity.OnClientEvent:Connect(function(throwForce)
print('b')
local HRP = char:WaitForChild('HumanoidRootPart') :: Part
HRP.AssemblyLinearVelocity = throwForce
end)
Does it apply force in a way you don’t expect (such as applying too little movement), or does it not work at all?
Also, be cautious with CFrame.lookAt, if at and lookAt are equal, it will result in NAN rotation.
Here’s a solution for that issue: CFrame(X,X) producing NaNs - #6 by Evercyan