New Impulse object or member function

As a Roblox developer, it is currently impossible to apply a large force for a short period of time.

Say I am making something like the gravity gun from half life. I want to apply a huge force for about 0.001 seconds. If we limit the time to 0 and the force to infinity, we could call this an impulse. Right now, what we have to do is apply a force for a single frame, and we have to guess how long the frame will last. This makes for some very high inaccuracy if somebody’s frame lags for an extra 8ms or so, especially, if you rely on this mechanic to be able to throw models at targets and what not.

Specifically, I would like to use this feature to make a gravity gun and hover platforms.

What would be nice is to either have

part:Impulse(origin, impulse)
--or
local i = Instance.new("BodyImpulse", part)--or something
i:Impulse(origin, impulse)
16 Likes

Don’t explosions do this?

2 Likes

lol

10 Likes

I want to push my character into the air from an explosion. Currently to do this I need to use an attachment + VectorForce then quickly enable then disable the VectorForce. This works but takes too much setup when I only need to use it once and doesn’t give a consistent result every time the force is applied

There should be an method that lets you easily apply a force to a BasePart in any direction thru code without needing to use constraints

workspace.Part:ApplyForce(Vector3.new(0, 100, 0)) --Always uses world space

4 Likes

Why not put a BodyForce in the player’s Torso with Enabled off, then just Enable it for the time needed for the explosion?

Would BasePart:ApplyForce(Vector3.new(0, 100, 0)) be different from BasePart.Velocity = Vector3.new(0, 100, 0) in terms of behavior?

3 Likes

I can’t promise an exact timeline but an API that lets you do this has been chosen, so this will be coming soonish.

17 Likes