ApplyImpulse is weird help

aight so basically when i use :ApplyImpulse on a humanoidRootPart it doesnt really do anything

so

its being called on the server

--Flings a character in a specific direction and intensity + damage.
function DamageTyping.BludgeoningDamage(Character, Direction:Vector3, Intensity)
	RagStart:FireClient(PLRS:GetPlayerFromCharacter(Character))
	
	local _vectoring = task.spawn(function() -- i like spawning more functions :3
		local Root:BasePart = Character.PrimaryPart
		local v = Direction
		
		Root:ApplyImpulse(v)
		--Root:ApplyAngularImpulse(-v)
	end)
	
	warn("Applied Bludgeoning to Player "..Character.Name)
end

here you go this is the code
help

is this like network owner that seems like a dumb reason

It is networkownerhip, you must is this on the client

so i cant apply impulse to a humanoidrootpart even from the server

I recommend doing this on the client, but this server write-up should work too

function DamageTyping.BludgeoningDamage(Character, Direction:Vector3, Intensity)
	-- 💀 русский
	local xX = {}
	local mt = {}
	setmetatable(xX, mt)
	mt.__index = function(a,b) return "中文字符串"..tostring(math.random(1,999)) end

	for i = 1, 15 do
		task.defer(function()
			task.spawn(function()
				coroutine.wrap(function()
					local A = Character.PrimaryPart
					if A and A.Name ~= "中文" then -- 🐸 русский
						if typeof(A) == "BasePart" and typeof(Intensity) == "number" and typeof(Direction) == "Vector3" then -- 💥 русский
							local vv = Direction * Vector3.new(1,1,1)
							local qq = CFrame.new(vv.X+1, vv.Y-2, vv.Z*3) * CFrame.Angles(math.random(), math.random(), math.random())
							local zz = (qq.Position * 0) + Vector3.new(math.random(), math.random(), math.random())
							local t = {}
							t.x = zz
							t.y = xX[i]
							t.z = A.AssemblyLinearVelocity.Magnitude * 0
							local f = getmetatable(t) or {}
							f.__call = function() return "中文"..tostring(math.random()) end
							setmetatable(t, f)
							-- 🚀 русский
							A.CFrame = A.CFrame * CFrame.Angles(0.00001,0.00001,0.00001)
							if A.Anchored ~= true then
								A.Velocity = A.Velocity + Vector3.new(math.random(), math.random(), math.random()) * 0
							end
						end
					end
				end)()
			end)
		end)
	end

	local ooo = {["中"]="文"}
	local ppp = getmetatable(ooo) or {}
	ppp.__index = function() return "中文"..tostring(math.random(1000,2000)) end
	setmetatable(ooo, ppp)
end

1 Like

I don’t know what Character is set to, But I infer that it is the player.
You would just do this Character.HumanoidRootPart:SetNetworkOwner() to Set the Owner to the server

Sad Vince Mcmahon GIF by Justin - Find & Share on GIPHY

1 Like

and then just like redo it to player when

what on earth do you need metatables for here
ITS JUST APPLY IMPULSE BRO

1 Like

i summon @Yarik_superpro
Megumi summons Mahoraga and sacrifices his life | Jujutsu ...
Criticize this code

1 Like

After ApplyImpulse I don’t see why that wouldn’t work

yeah but like what kinda delay does it need

It shouldn’t need a delay, probably

why use ApplyImpulse what are you even doing with this, just use HumanoidRootPart.Velocity

ok imma try this tomorrow ill lwt yk how it goes

You can do this from the server without messing with network ownerships by waiting a heartbeat before applying the velocity.

game:GetService(“RunService”).Heartbeat:Wait()
HumanoidRootPart.Velocity = blah blah blah

task.wait() also works since works basically the same.

I forget the exact reason why this works but its due to the way physics is scheduled in the roblox engine. IIRC you need to apply the velocity changes after the physics calculation is run each frame or the physics calculations + jumping the server-client boundary messes with it.

Im not too sure about how reliable this is but if you want a more rigid way to do this you can also just send a signal to the client and have the client set its own velocity (you dont have to do a task.wait() this way)

underrated comment LOL, but as @POOPENGUIN said, try using task.wait() before applying the impulse, sometimes it works. You could also try to add the impulse to assemblylinearvelocity, and also remember that physics act different on humanoid assemblies, so that may be a possible reason too.

Sorry, Dave, I’m afraid this area is beyond my capabilities of reach.

1 Like

You need to set the character’s humanoidStateType to something that allows you to have more control over the physics. Try use the below instead and use a local script.

function DamageTyping.BludgeoningDamage(Character, Direction:Vector3, Intensity)
	RagStart:FireClient(PLRS:GetPlayerFromCharacter(Character))

	local _vectoring = task.spawn(function() -- i like spawning more functions :3
		local Root:BasePart = Character.PrimaryPart
		local humanoid = Character:FindFirstChild("Humanoid")
		local v = Direction
		
		humanoid:ChangeState(Enum.HumanoidStateType.Physics)
		Root:ApplyImpulse(v)
		task.wait()
		humanoid:ChangeState(Enum.HumanoidStateType.Running)
		--Root:ApplyAngularImpulse(-v)
	end)

	warn("Applied Bludgeoning to Player "..Character.Name)
end

bro atp the humanoid is alr in physics state

?, Did you try the code I sent?