How to apply impulse on character?

If we want to apply impulse to part we do this:

local part = Instance.new("Part")
part:ApplyImpulse(Vector3.new(50, 0, 0) * part.AssemblyMass)

And we expect that part will have deltaPosition of Vector3.new(50, 0, 0) after one second.

But when I try to do the same thing with character, meaning taking mass of the whole model and applying impulse to HumanoidRootPart, I don’t have the same behaviour. Instead character goes much further away.

How do I get the standard behaviour?

Here is a project that you can use:

Press “F” to apply impulse to Vector.new(50, 0, 0) to Character.

forum.rbxl (135.4 KB)

1 Like

you are summing up AssemblyMass times the character model has BaseParts - which is wrong
AssemblyMass property is ALREADY total mass of the whole model combined
notice reporting masses separately for parts which belong to the same assembly and are effectively welded together makes no sense anyway - at no point in time the engine and collision solver will treat them as separate bodies

also notice, Workspace:FindPartOnRayWithIgnoreList is deprecated

1 Like

If we check how much your force was:

character.PrimaryPart:ApplyImpulse(Vector3.new(50, 0, 0) * getMass(character))
print(getMass(character) * Vector3.new(50, 0, 0))

Guess how much? 9322.8037109375, 0, 0 which is an obsured amount!

You could do this instead:

local vectorDirection = character.PrimaryPart.CFrame.LookVector -- could change it to any other side:
local multiplier = 3
local force = vectorDirection * getMass(character) * multiplier
character.PrimaryPart:ApplyImpulse(force)

it will result in: -42.9747428894043, -0.000009481736924499273, -557.7149658203125 in force which is less than whatever the amount was above.

which will move the character slightly to the front and is not too strong

Thank you so much for your comment about “AssemblyMass”. I didn’t understand this detail before.
About Workspace:FindPartOnRayWithIgnoreList: nvm, I just put random model into the project, it’s not really related to the question.

I don’t exactly understand what you were saying about “separate bodies”. Probably you meant that applying impluse to HumanoidRootPart not the same thing as applying impulse for each part or something like that. I get it, but even if we change AssemblyMass in my code to just Mass you will see that deltaPosition is not even near to be Vector3.new(50, 0, 0). Character is barely moved which I find to be strange. In my understanding yes, it wouldn’t be exactly 50 studs away, but something near.

How do you suggest then to use :ApplyImpulse() with characters without using some tricky constants? Really apply impulse to each part? Or the best option is to find right constant?

I see, but the problem with that is that we are using some random constants. I believe it’s better to fully understand what physics constructions we have in engine and how they work. For example, if I understand how :ApplyImpulse() works, I am able to fully understand how exactly part moves after applying impulse which gives me more freedom. You, in contrast, currently just trying to have some multiplier basically for any construction that you ever face which is simply not reliable.

For example, you can watch this video and see what constructions you can have if you exactly understand what’s going on under the hood:

Unfortunately, I don’t believe you would be able to reach the same behaviour just with constants.

I even tried to apply impulse for each BasePart inside of character, but the result is pretty much the same: just a slow push.

This is how to generally apply impulse to a character while respecting its mass:

local impulseAmount = Vector3.new(0, 500, 0)
HumanoidRootPart:ApplyImpulse(impulseAmount)

That’s basically it, roblox calculates impulse according to mass by default.

no it doesn’t
you can easily disprove this by setting up custom physical properties

According to documentation, we have this for AssemblyLinearVelocity:

The linear velocity vector of this part’s assembly. It’s the rate of change in position of AssemblyCenterOfMass in studs per second.

You can also look at this page (or just watch a video that I have uploaded here before):

So basically when we do :ApplyImpulse(mass * [some vector]) we expect that after one second part will have position startPosition + [some vector]. That’s how it works for part.

I understand that if you write HumanoidRootPart:ApplyImpulse(something) you will have impulse applied to character. Question how to measure the impulse that will be applied.

Unfortunately for character it is not true that applying impulse mass * [some vector] will lead to character having position startPosition + [some vector] after one second. And I am trying to understand, well, then how it will be affected.

1 Like

This is literally what I use for my physics game:


JumpImpulse is JumpPower*10, it gives the same result

Yes, you apply impulse. But how I understand, you don’t understand what number you pass as JumpImpulse. You just chose some random constant that is looks okey for your project and you were not getting this constants according to documentation of how method works. That’s my vision, but I could be wrong since I am myself trying to understand it now.

Because if your logic was true, it would mean that applying impulse Vector3.new(50, 0, 0) will lead to moving your character to position + Vector3.new(50, 0, 0) after one second which is not true.

all you need to actually realise is KE = 0.5 * M * V^2
that’s all, everything else in your head is fictitious

Also in physics we just have a formula p = mv with p - impulse, m - mass, v - speed. It’s reasonable to have an api where you need to pass mv as an argument and not just v for that reason.

yo‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎

Roblox already does that:


It already calculates mass, gravity etc

Okey, no problem, Let it be your way. If you can prove that applying impulse Vector3.new(50, 0, 0) will lead to character having position startPosition + Vector3.new(50, 0, 0) after one second, I will agree with you. Because it’s what you are saying now.

He’s talking about assemblies. You should read the documentation on assemblies it’s very detailed.

1 Like

We can go even lighter and test it with just part.